!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b="ui-effects-",c=a; return a.effects={effect:{}},function(a,b){function c(a,b,c){var d=l[b.type]||{};return null==a?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max")[0],o=a.each;n.style.cssText="background-color:rgba(1,1,1,.5)",m.rgba=n.style.backgroundColor.indexOf("rgba")>-1,o(k,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),j.fn=a.extend(j.prototype,{parse:function(e,g,h,i){if(e===b)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=a(e).css(g),g=b);var l=this,m=a.type(e),n=this._rgba=[];return g!==b&&(e=[e,g,h,i],m="array"),"string"===m?this.parse(d(e)||f._default):"array"===m?(o(k.rgba.props,function(a,b){n[b.idx]=c(e[b.idx],b)}),this):"object"===m?(e instanceof j?o(k,function(a,b){e[b.cache]&&(l[b.cache]=e[b.cache].slice())}):o(k,function(b,d){var f=d.cache;o(d.props,function(a,b){if(!l[f]&&d.to){if("alpha"===a||null==e[a])return;l[f]=d.to(l._rgba)}l[f][b.idx]=c(e[a],b,!0)}),l[f]&&a.inArray(null,l[f].slice(0,3))<0&&(l[f][3]=1,d.from&&(l._rgba=d.from(l[f])))}),this):void 0},is:function(a){var b=j(a),c=!0,d=this;return o(k,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],o(e.props,function(a,b){if(null!=g[b.idx])return c=g[b.idx]===f[b.idx]})),c}),c},_space:function(){var a=[],b=this;return o(k,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var d=j(a),e=d._space(),f=k[e],g=0===this.alpha()?j("transparent"):this,h=g[f.cache]||f.to(g._rgba),i=h.slice();return d=d[f.cache],o(f.props,function(a,e){var f=e.idx,g=h[f],j=d[f],k=l[e.type]||{};null!==j&&(null===g?i[f]=j:(k.mod&&(j-g>k.mod/2?g+=k.mod:g-j>k.mod/2&&(g-=k.mod)),i[f]=c((j-g)*b+g,e)))}),this[e](i)},blend:function(b){if(1===this._rgba[3])return this;var c=this._rgba.slice(),d=c.pop(),e=j(b)._rgba;return j(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return null==a?b>2?1:0:a});return 1===c[3]&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return null==a&&(a=b>2?1:0),b&&b<3&&(a=Math.round(100*a)+"%"),a});return 1===c[3]&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(255*d)),"#"+a.map(c,function(a){return a=(a||0).toString(16),1===a.length?"0"+a:a}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),j.fn.parse.prototype=j.fn,k.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b,c,d=a[0]/255,e=a[1]/255,f=a[2]/255,g=a[3],h=Math.max(d,e,f),i=Math.min(d,e,f),j=h-i,k=h+i,l=.5*k;return b=i===h?0:d===h?60*(e-f)/j+360:e===h?60*(f-d)/j+120:60*(d-e)/j+240,c=0===j?0:l<=.5?j/k:j/(2-k),[Math.round(b)%360,c,l,null==g?1:g]},k.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],f=a[3],g=d<=.5?d*(1+c):d+c-d*c,h=2*d-g;return[Math.round(255*e(h,g,b+1/3)),Math.round(255*e(h,g,b)),Math.round(255*e(h,g,b-1/3)),f]},o(k,function(d,e){var f=e.props,g=e.cache,i=e.to,k=e.from;j.fn[d]=function(d){if(i&&!this[g]&&(this[g]=i(this._rgba)),d===b)return this[g].slice();var e,h=a.type(d),l="array"===h||"object"===h?d:arguments,m=this[g].slice();return o(f,function(a,b){var d=l["object"===h?a:b.idx];null==d&&(d=m[b.idx]),m[b.idx]=c(d,b)}),k?(e=j(k(m)),e[g]=m,e):j(m)},o(f,function(b,c){j.fn[b]||(j.fn[b]=function(e){var f,g=a.type(e),i="alpha"===b?this._hsla?"hsla":"rgba":d,j=this[i](),k=j[c.idx];return"undefined"===g?k:("function"===g&&(e=e.call(this,k),g=a.type(e)),null==e&&c.empty?this:("string"===g&&(f=h.exec(e),f&&(e=k+parseFloat(f[2])*("+"===f[1]?1:-1))),j[c.idx]=e,this[i](j)))})})}),j.hook=function(b){var c=b.split(" ");o(c,function(b,c){a.cssHooks[c]={set:function(b,e){var f,g,h="";if("transparent"!==e&&("string"!==a.type(e)||(f=d(e)))){if(e=j(f||e),!m.rgba&&1!==e._rgba[3]){for(g="backgroundColor"===c?b.parentNode:b;(""===h||"transparent"===h)&&g&&g.style;)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(i){}e=e.blend(h&&"transparent"!==h?h:"_default")}e=e.toRgbaString()}try{b.style[c]=e}catch(i){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=j(b.elem,c),b.end=j(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},j.hook(g),a.cssHooks.borderColor={expand:function(a){var b={};return o(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},f=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(c),function(){function b(b){var c,d,e=b.ownerDocument.defaultView?b.ownerDocument.defaultView.getComputedStyle(b,null):b.currentStyle,f={};if(e&&e.length&&e[0]&&e[e[0]])for(d=e.length;d--;)c=e[d],"string"==typeof e[c]&&(f[a.camelCase(c)]=e[c]);else for(c in e)"string"==typeof e[c]&&(f[c]=e[c]);return f}function d(b,c){var d,e,g={};for(d in c)e=c[d],b[d]!==e&&(f[d]||!a.fx.step[d]&&isNaN(parseFloat(e))||(g[d]=e));return g}var e=["add","remove","toggle"],f={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(b,d){a.fx.step[d]=function(a){("none"!==a.end&&!a.setAttr||1===a.pos&&!a.setAttr)&&(c.style(a.elem,d,a.end),a.setAttr=!0)}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a.effects.animateClass=function(c,f,g,h){var i=a.speed(f,g,h);return this.queue(function(){var f,g=a(this),h=g.attr("class")||"",j=i.children?g.find("*").addBack():g;j=j.map(function(){var c=a(this);return{el:c,start:b(this)}}),f=function(){a.each(e,function(a,b){c[b]&&g[b+"Class"](c[b])})},f(),j=j.map(function(){return this.end=b(this.el[0]),this.diff=d(this.start,this.end),this}),g.attr("class",h),j=j.map(function(){var b=this,c=a.Deferred(),d=a.extend({},i,{queue:!1,complete:function(){c.resolve(b)}});return this.el.animate(this.diff,d),c.promise()}),a.when.apply(a,j.get()).done(function(){f(),a.each(arguments,function(){var b=this.el;a.each(this.diff,function(a){b.css(a,"")})}),i.complete.call(g[0])})})},a.fn.extend({addClass:function(b){return function(c,d,e,f){return d?a.effects.animateClass.call(this,{add:c},d,e,f):b.apply(this,arguments)}}(a.fn.addClass),removeClass:function(b){return function(c,d,e,f){return arguments.length>1?a.effects.animateClass.call(this,{remove:c},d,e,f):b.apply(this,arguments)}}(a.fn.removeClass),toggleClass:function(b){return function(c,d,e,f,g){return"boolean"==typeof d||void 0===d?e?a.effects.animateClass.call(this,d?{add:c}:{remove:c},e,f,g):b.apply(this,arguments):a.effects.animateClass.call(this,{toggle:c},d,e,f)}}(a.fn.toggleClass),switchClass:function(b,c,d,e,f){return a.effects.animateClass.call(this,{add:c,remove:b},d,e,f)}})}(),function(){function c(b,c,d,e){return a.isPlainObject(b)&&(c=b,b=b.effect),b={effect:b},null==c&&(c={}),a.isFunction(c)&&(e=c,d=null,c={}),("number"==typeof c||a.fx.speeds[c])&&(e=d,d=c,c={}),a.isFunction(d)&&(e=d,d=null),c&&a.extend(b,c),d=d||c.duration,b.duration=a.fx.off?0:"number"==typeof d?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,b.complete=e||c.complete,b}function d(b){return!(b&&"number"!=typeof b&&!a.fx.speeds[b])||("string"==typeof b&&!a.effects.effect[b]||(!!a.isFunction(b)||"object"==typeof b&&!b.effect))}a.extend(a.effects,{version:"1.11.4",save:function(a,c){for(var d=0;d").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;try{f.id}catch(g){f=document.body}return b.wrap(d),(b[0]===f||a.contains(b[0],f))&&a(f).focus(),d=b.parent(),"static"===b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),b.css(e),d.css(c).show()},removeWrapper:function(b){var c=document.activeElement;return b.parent().is(".ui-effects-wrapper")&&(b.parent().replaceWith(b),(b[0]===c||a.contains(b[0],c))&&a(c).focus()),b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(){function b(b){function c(){a.isFunction(f)&&f.call(e[0]),a.isFunction(b)&&b()}var e=a(this),f=d.complete,h=d.mode;(e.is(":hidden")?"hide"===h:"show"===h)?(e[h](),c()):g.call(e[0],d,c)}var d=c.apply(this,arguments),e=d.mode,f=d.queue,g=a.effects.effect[d.effect];return a.fx.off||!g?e?this[e](d.duration,d.complete):this.each(function(){d.complete&&d.complete.call(this)}):f===!1?this.each(b):this.queue(f||"fx",b)},show:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="show",this.effect.call(this,e)}}(a.fn.show),hide:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)}}(a.fn.hide),toggle:function(a){return function(b){if(d(b)||"boolean"==typeof b)return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="toggle",this.effect.call(this,e)}}(a.fn.toggle),cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}})}(),function(){var b={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,c){b[c]=function(b){return Math.pow(b,a+2)}}),a.extend(b,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}),a.each(b,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(2*a)/2:1-c(a*-2+2)/2}})}(),a.effects}); !function(a){a.fn.hoverIntent=function(b,c,d){var e={interval:100,sensitivity:6,timeout:0};e="object"==typeof b?a.extend(e,b):a.isFunction(c)?a.extend(e,{over:b,out:c,selector:d}):a.extend(e,{over:b,out:b,selector:c});var f,g,h,i,j=function(a){f=a.pageX,g=a.pageY},k=function(b,c){return c.hoverIntent_t=clearTimeout(c.hoverIntent_t),Math.sqrt((h-f)*(h-f)+(i-g)*(i-g)) -1); this.superfish('hide'); if(!this.parents('.' + o.hoverClass).length){ o.onIdle.call(getMenu(this)); if(o.$path.length){ $.proxy(over, o.$path)(); }} }, out=function (){ var $this=$(this), o=getOptions($this); if(ios){ $.proxy(close, $this, o)(); }else{ clearTimeout(o.sfTimer); o.sfTimer=setTimeout($.proxy(close, $this, o), o.delay); }}, touchHandler=function (e){ var $this=$(this), o=getOptions($this), $ul=$this.siblings(e.data.popUpSelector); if(o.onHandleTouch.call($ul)===false){ return this; } if($ul.length > 0&&$ul.is(':hidden')){ $this.one('click.superfish', false); if(e.type==='MSPointerDown'||e.type==='pointerdown'){ $this.trigger('focus'); }else{ $.proxy(over, $this.parent('li'))(); }} }, applyHandlers=function ($menu, o){ var targets='li:has(' + o.popUpSelector + ')'; if($.fn.hoverIntent&&!o.disableHI){ $menu.hoverIntent(over, out, targets); }else{ $menu .on('mouseenter.superfish', targets, over) .on('mouseleave.superfish', targets, out); } var touchevent='MSPointerDown.superfish'; if(unprefixedPointerEvents){ touchevent='pointerdown.superfish'; } if(!ios){ touchevent +=' touchend.superfish'; } if(wp7){ touchevent +=' mousedown.superfish'; } $menu .on('focusin.superfish', 'li', over) .on('focusout.superfish', 'li', out) .on(touchevent, 'a', o, touchHandler); }; return { hide: function (instant){ if(this.length){ var $this=this, o=getOptions($this); if(!o){ return this; } var not=(o.retainPath===true) ? o.$path:'', $ul=$this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector), speed=o.speedOut; if(instant){ $ul.show(); speed=0; } o.retainPath=false; if(o.onBeforeHide.call($ul)===false){ return this; } $ul.stop(true, true).animate(o.animationOut, speed, function (){ var $this=$(this); o.onHide.call($this); }); } return this; }, show: function (){ var o=getOptions(this); if(!o){ return this; } var $this=this.addClass(o.hoverClass), $ul=$this.children(o.popUpSelector); if(o.onBeforeShow.call($ul)===false){ return this; } $ul.stop(true, true).animate(o.animation, o.speed, function (){ o.onShow.call($ul); }); return this; }, destroy: function (){ return this.each(function (){ var $this=$(this), o=$this.data('sfOptions'), $hasPopUp; if(!o){ return false; } $hasPopUp=$this.find(o.popUpSelector).parent('li'); clearTimeout(o.sfTimer); toggleMenuClasses($this, o); toggleAnchorClass($hasPopUp); toggleTouchAction($this); $this.off('.superfish').off('.hoverIntent'); $hasPopUp.children(o.popUpSelector).attr('style', function (i, style){ return style.replace(/display[^;]+;?/g, ''); }); o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass); $this.find('.' + o.hoverClass).removeClass(o.hoverClass); o.onDestroy.call($this); $this.removeData('sfOptions'); }); }, init: function (op){ return this.each(function (){ var $this=$(this); if($this.data('sfOptions')){ return false; } var o=$.extend({}, $.fn.superfish.defaults, op), $hasPopUp=$this.find(o.popUpSelector).parent('li'); o.$path=setPathToCurrent($this, o); $this.data('sfOptions', o); toggleMenuClasses($this, o, true); toggleAnchorClass($hasPopUp, true); toggleTouchAction($this); applyHandlers($this, o); $hasPopUp.not('.' + c.bcClass).superfish('hide', true); o.onInit.call(this); }); }};})(); $.fn.superfish=function (method, args){ if(methods[method]){ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if(typeof method==='object'||! method){ return methods.init.apply(this, arguments); }else{ return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish'); }}; $.fn.superfish.defaults={ popUpSelector: 'ul,.sf-mega', hoverClass: 'sfHover', pathClass: 'overrideThisToUse', pathLevels: 1, delay: 800, animation: {opacity: 'show'}, animationOut: {opacity: 'hide'}, speed: 'normal', speedOut: 'fast', cssArrows: true, disableHI: false, onInit: $.noop, onBeforeShow: $.noop, onShow: $.noop, onBeforeHide: $.noop, onHide: $.noop, onIdle: $.noop, onDestroy: $.noop, onHandleTouch: $.noop };})(jQuery, window); if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); !function(){var e=function(t,i){function s(){this.q=[],this.add=function(e){this.q.push(e)};var e,t;this.call=function(){for(e=0,t=this.q.length;e
',e.appendChild(e.resizeSensor),{fixed:1,absolute:1}[o(e,"position")]||(e.style.position="relative");var d,r,l=e.resizeSensor.childNodes[0],c=l.childNodes[0],h=e.resizeSensor.childNodes[1],a=(h.childNodes[0],function(){c.style.width=l.offsetWidth+10+"px",c.style.height=l.offsetHeight+10+"px",l.scrollLeft=l.scrollWidth,l.scrollTop=l.scrollHeight,h.scrollLeft=h.scrollWidth,h.scrollTop=h.scrollHeight,d=e.offsetWidth,r=e.offsetHeight});a();var f=function(){e.resizedAttached&&e.resizedAttached.call()},u=function(e,t,i){e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i)},p=function(){e.offsetWidth==d&&e.offsetHeight==r||f(),a()};u(l,"scroll",p),u(h,"scroll",p)}var d=Object.prototype.toString.call(t),r="[object Array]"===d||"[object NodeList]"===d||"[object HTMLCollection]"===d||"undefined"!=typeof jQuery&&t instanceof jQuery||"undefined"!=typeof Elements&&t instanceof Elements;if(r)for(var l=0,c=t.length;l' + _self.settings.labels['errorMessage'] + '

'; }, labels: { 'errorMessage': 'Source could not be found...', 'sequenceInfo.of': ' of ', 'close': 'Close', 'navigator.prev': 'Prev', 'navigator.next': 'Next', 'navigator.play': 'Play', 'navigator.pause': 'Pause' }, markup: function (){ _self.objects.body.append(_self.objects.overlay=$('
'), _self.objects.loading=$('
'), _self.objects.case=$('') ); _self.objects.case.after(_self.objects.close=$('' + _self.settings.labels['close'] + ''), _self.objects.nav=$('
') ); _self.objects.nav.append(_self.objects.prev=$('' + _self.settings.labels['navigator.prev'] + '').hide(), _self.objects.next=$('' + _self.settings.labels['navigator.next'] + '').hide(), _self.objects.play=$('' + _self.settings.labels['navigator.play'] + '').hide(), _self.objects.pause=$('' + _self.settings.labels['navigator.pause'] + '').hide() ); _self.objects.case.append(_self.objects.content=$('
'), _self.objects.info=$('
') ); _self.objects.content.append(_self.objects.contentInner=$('
') ); _self.objects.info.append(_self.objects.sequenceInfo=$('
'), _self.objects.title=$('

'), _self.objects.caption=$('

') ); }, onInit: {}, onStart: {}, onFinish: {}, onResize: {}, onClose: {}, onCleanup: {}}, options, _self.origin.data ? _self.origin.data('lc-options'):{}); _self.objects.document=$('html'); _self.objects.body=$('body'); _self._callHooks(_self.settings.onInit); _self.objectData=_self._setObjectData(this); _self._addElements(); _self._open(); _self.dimensions=_self.getViewportDimensions(); }, get: function (name){ return _self.objects[name]; }, getObjectData: function (){ return _self.objectData; }, _setObjectData: function (object){ var $object=$(object), objectData={ this: $(object), title: _self.settings.title||$object.attr(_self._prefixAttributeName('title'))||$object.attr('title'), caption: _self.settings.caption||$object.attr(_self._prefixAttributeName('caption'))||$object.children('img').attr('alt'), url: _self._determineUrl(), requestType: _self.settings.ajax.type, requestData: _self.settings.ajax.data, requestDataType: _self.settings.ajax.dataType, rel: $object.attr(_self._determineAttributeSelector()), type: _self.settings.type||_self._verifyDataType(_self._determineUrl()), isPartOfSequence: _self.settings.useAsCollection||_self._isPartOfSequence($object.attr(_self.settings.attr), ':'), isPartOfSequenceWithSlideshow: _self._isPartOfSequence($object.attr(_self.settings.attr), ':slideshow'), currentIndex: $(_self._determineAttributeSelector()).index($object), sequenceLength: $(_self._determineAttributeSelector()).length }; objectData.sequenceInfo=(objectData.currentIndex + 1) + _self.settings.labels['sequenceInfo.of'] + objectData.sequenceLength; objectData.prevIndex=objectData.currentIndex - 1; objectData.nextIndex=objectData.currentIndex + 1; return objectData; }, _prefixAttributeName: function (name){ return 'data-' + _self.settings.attrPrefix + name; }, _determineLinkTarget: function (){ return _self.settings.href||$(_self.origin).attr(_self._prefixAttributeName('href'))||$(_self.origin).attr('href'); }, _determineAttributeSelector: function (){ var $origin=$(_self.origin), selector=''; if(typeof _self.cache.selector!=='undefined'){ selector=_self.cache.selector; }else if(_self.settings.useCategories===true&&$origin.attr(_self._prefixAttributeName('categories'))){ var categories=$origin.attr(_self._prefixAttributeName('categories')).split(' '); $.each(categories, function (index, category){ if(index > 0){ selector +=','; } selector +='[' + _self._prefixAttributeName('categories') + '~="' + category + '"]'; }); }else{ selector='[' + _self.settings.attr + '="' + $origin.attr(_self.settings.attr) + '"]'; } _self.cache.selector=selector; return selector; }, _determineUrl: function (){ var dataUrl=_self._verifyDataUrl(_self._determineLinkTarget()), width=0, density=0, supportLevel='', url; $.each(dataUrl, function (index, src){ switch (_self._verifyDataType(src.url)){ case 'video': var video=document.createElement('video'), videoType=_self._verifyDataType(src.url) + '/' + _self._getFileUrlSuffix(src.url); if(supportLevel!=='probably'&&supportLevel!==video.canPlayType(videoType)&&video.canPlayType(videoType)!==''){ supportLevel=video.canPlayType(videoType); url=src.url; } break; default: if(_self._devicePixelRatio() >=src.density && src.density >=density && _self._matchMedia()('screen and (min-width:' + src.width + 'px)').matches && src.width >=width ){ width=src.width; density=src.density; url=src.url; } break; }}); return url; }, _normalizeUrl: function (url){ var srcExp=/^\d+$/; return url.split(',').map(function (str){ var src={ width: 0, density: 0 }; str.trim().split(/\s+/).forEach(function (url, i){ if(i===0){ return src.url=url; } var value=url.substring(0, url.length - 1), lastChar=url[url.length - 1], intVal=parseInt(value, 10), floatVal=parseFloat(value); if(lastChar==='w'&&srcExp.test(value)){ src.width=intVal; }else if(lastChar==='h'&&srcExp.test(value)){ src.height=intVal; }else if(lastChar==='x'&&!isNaN(floatVal)){ src.density=floatVal; }}); return src; }); }, _isPartOfSequence: function (rel, expression){ var getSimilarLinks=$('[' + _self.settings.attr + '="' + rel + '"]'), regexp=new RegExp(expression); return (regexp.test(rel)&&getSimilarLinks.length > 1); }, isSlideshowEnabled: function (){ return (_self.objectData.isPartOfSequence&&(_self.settings.slideshow===true||_self.objectData.isPartOfSequenceWithSlideshow===true)); }, _loadContent: function (){ if(_self.cache.originalObject){ _self._restoreObject(); } _self._createObject(); }, _createObject: function (){ var $object; switch (_self.objectData.type){ case 'image': $object=$(new Image()); $object.attr({ 'src': _self.objectData.url, 'alt': _self.objectData.title }); break; case 'inline': $object=$('
'); $object.html(_self._cloneObject($(_self.objectData.url))); $.each(_self.settings.inline, function (name, value){ $object.attr(_self._prefixAttributeName(name), value); }); break; case 'ajax': $object=$('
'); $.each(_self.settings.ajax, function (name, value){ if(name!=='data'){ $object.attr(_self._prefixAttributeName(name), value); }}); break; case 'flash': $object=$(''); $.each(_self.settings.flash, function (name, value){ $object.attr(name, value); }); break; case 'video': $object=$(''); $object.attr('src', _self.objectData.url); $.each(_self.settings.video, function (name, value){ $object.attr(name, value); }); break; default: $object=$(''); $object.attr({ 'src': _self.objectData.url }); $.each(_self.settings.iframe, function (name, value){ $object.attr(name, value); }); break; } _self._addObject($object); _self._loadObject($object); }, _addObject: function ($object){ _self.objects.contentInner.html($object); _self._loading('start'); _self._callHooks(_self.settings.onStart); if(_self.settings.showSequenceInfo===true&&_self.objectData.isPartOfSequence){ _self.objects.sequenceInfo.html(_self.objectData.sequenceInfo); _self.objects.sequenceInfo.show(); }else{ _self.objects.sequenceInfo.empty(); _self.objects.sequenceInfo.hide(); } if(_self.settings.showTitle===true&&_self.objectData.title!==undefined&&_self.objectData.title!==''){ _self.objects.title.html(_self.objectData.title); _self.objects.title.show(); }else{ _self.objects.title.empty(); _self.objects.title.hide(); } if(_self.settings.showCaption===true&&_self.objectData.caption!==undefined&&_self.objectData.caption!==''){ _self.objects.caption.html(_self.objectData.caption); _self.objects.caption.show(); }else{ _self.objects.caption.empty(); _self.objects.caption.hide(); }}, _loadObject: function ($object){ switch (_self.objectData.type){ case 'inline': if($(_self.objectData.url)){ _self._showContent($object); }else{ _self.error(); } break; case 'ajax': $.ajax($.extend({}, _self.settings.ajax, { url: _self.objectData.url, type: _self.objectData.requestType, dataType: _self.objectData.requestDataType, data: _self.objectData.requestData, success: function (data, textStatus, jqXHR){ if(_self.objectData.requestDataType==='json'){ _self.objectData.data=data; }else{ $object.html(data); } _self._showContent($object); }, error: function (jqXHR, textStatus, errorThrown){ _self.error(); }}) ); break; case 'flash': _self._showContent($object); break; case 'video': if(typeof($object.get(0).canPlayType)==='function'||_self.objects.case.find('video').length===0){ _self._showContent($object); }else{ _self.error(); } break; default: if(_self.objectData.url){ $object.on('load', function (){ _self._showContent($object); }); $object.on('error', function (){ _self.error(); }); }else{ _self.error(); } break; }}, error: function (){ _self.objectData.type='error'; var $object=$('
'); $object.html(_self.settings.errorMessage); _self.objects.contentInner.html($object); _self._showContent(_self.objects.contentInner); }, _calculateDimensions: function ($object){ _self._cleanupDimensions(); var dimensions={ ratio: 1, objectWidth: $object.attr('width') ? $object.attr('width'):$object.attr(_self._prefixAttributeName('width')), objectHeight: $object.attr('height') ? $object.attr('height'):$object.attr(_self._prefixAttributeName('height')) }; if(!_self.settings.disableShrink){ dimensions.maxWidth=parseInt(_self.dimensions.windowWidth * _self.settings.shrinkFactor); dimensions.maxHeight=parseInt(_self.dimensions.windowHeight * _self.settings.shrinkFactor); if(dimensions.maxWidth > _self.settings.maxWidth){ dimensions.maxWidth=_self.settings.maxWidth; } if(dimensions.maxHeight > _self.settings.maxHeight){ dimensions.maxHeight=_self.settings.maxHeight; } dimensions.differenceWidthAsPercent=parseInt(100 / dimensions.maxWidth * dimensions.objectWidth); dimensions.differenceHeightAsPercent=parseInt(100 / dimensions.maxHeight * dimensions.objectHeight); switch (_self.objectData.type){ case 'image': case 'flash': case 'video': case 'iframe': case 'ajax': case 'inline': if(_self.objectData.type==='image'||_self.settings.fixedRatio===true){ if(dimensions.differenceWidthAsPercent > 100&&dimensions.differenceWidthAsPercent > dimensions.differenceHeightAsPercent){ dimensions.objectWidth=dimensions.maxWidth; dimensions.objectHeight=parseInt(dimensions.objectHeight / dimensions.differenceWidthAsPercent * 100); } if(dimensions.differenceHeightAsPercent > 100&&dimensions.differenceHeightAsPercent > dimensions.differenceWidthAsPercent){ dimensions.objectWidth=parseInt(dimensions.objectWidth / dimensions.differenceHeightAsPercent * 100); dimensions.objectHeight=dimensions.maxHeight; } if(dimensions.differenceHeightAsPercent > 100&&dimensions.differenceWidthAsPercent < dimensions.differenceHeightAsPercent){ dimensions.objectWidth=parseInt(dimensions.maxWidth / dimensions.differenceHeightAsPercent * dimensions.differenceWidthAsPercent); dimensions.objectHeight=dimensions.maxHeight; } break; } case 'error': if(!isNaN(dimensions.objectWidth)&&dimensions.objectWidth > dimensions.maxWidth){ dimensions.objectWidth=dimensions.maxWidth; } break; default: if((isNaN(dimensions.objectWidth)||dimensions.objectWidth > dimensions.maxWidth)&&!_self.settings.forceWidth){ dimensions.objectWidth=dimensions.maxWidth; } if(((isNaN(dimensions.objectHeight)&&dimensions.objectHeight!=='auto')||dimensions.objectHeight > dimensions.maxHeight)&&!_self.settings.forceHeight){ dimensions.objectHeight=dimensions.maxHeight; } break; }} if(_self.settings.forceWidth){ try { dimensions.objectWidth=_self.settings[_self.objectData.type].width; } catch (e){ dimensions.objectWidth=_self.settings.width||dimensions.objectWidth; } dimensions.maxWidth=null; } if($object.attr(_self._prefixAttributeName('max-width'))){ dimensions.maxWidth=$object.attr(_self._prefixAttributeName('max-width')); } if(_self.settings.forceHeight){ try { dimensions.objectHeight=_self.settings[_self.objectData.type].height; } catch (e){ dimensions.objectHeight=_self.settings.height||dimensions.objectHeight; } dimensions.maxHeight=null; } if($object.attr(_self._prefixAttributeName('max-height'))){ dimensions.maxHeight=$object.attr(_self._prefixAttributeName('max-height')); } _self._adjustDimensions($object, dimensions); }, _adjustDimensions: function ($object, dimensions){ $object.css({ 'width': dimensions.objectWidth, 'height': dimensions.objectHeight, 'max-width': dimensions.maxWidth, 'max-height': dimensions.maxHeight }); _self.objects.contentInner.css({ 'width': $object.outerWidth(), 'height': $object.outerHeight(), 'max-width': '100%' }); _self.objects.case.css({ 'width': _self.objects.contentInner.outerWidth() }); _self.objects.case.css({ 'margin-top': parseInt(-(_self.objects.case.outerHeight() / 2)), 'margin-left': parseInt(-(_self.objects.case.outerWidth() / 2)) }); }, _loading: function (process){ if(process==='start'){ _self.objects.case.addClass(_self.settings.classPrefix + 'loading'); _self.objects.loading.show(); }else if(process==='end'){ _self.objects.case.removeClass(_self.settings.classPrefix + 'loading'); _self.objects.loading.hide(); }}, getViewportDimensions: function (){ return { windowWidth: $(window).innerWidth(), windowHeight: $(window).innerHeight() };}, _verifyDataUrl: function (dataUrl){ if(!dataUrl||dataUrl===undefined||dataUrl===''){ return false; } if(dataUrl.indexOf('#') > -1){ dataUrl=dataUrl.split('#'); dataUrl='#' + dataUrl[dataUrl.length - 1]; } return _self._normalizeUrl(dataUrl.toString()); }, _getFileUrlSuffix: function (url){ return url.toLowerCase().split('?')[0].split('.')[1]; }, _verifyDataType: function (url){ var typeMapping=_self.settings.typeMapping; if(!url){ return false; } for (var key in typeMapping){ if(typeMapping.hasOwnProperty(key)){ var suffixArr=typeMapping[key].split(','); for (var i=0; i < suffixArr.length; i++){ var suffix=suffixArr[i].toLowerCase(), regexp=new RegExp('\.(' + suffix + ')$', 'i'), str=url.toLowerCase().split('?')[0].substr(-5); if(regexp.test(str)===true||(key==='inline'&&(url.indexOf(suffix) > -1))){ return key; }} }} return 'iframe'; }, _addElements: function (){ if(typeof _self.objects.case!=='undefined'&&$('#' + _self.objects.case.attr('id')).length){ return; } _self.settings.markup(); }, _showContent: function ($object){ _self.objects.document.attr(_self._prefixAttributeName('type'), _self.objectData.type); _self.cache.object=$object; _self._calculateDimensions($object); _self._callHooks(_self.settings.onFinish); switch (_self.transition.in()){ case 'scrollTop': case 'scrollRight': case 'scrollBottom': case 'scrollLeft': case 'scrollHorizontal': case 'scrollVertical': _self.transition.scroll(_self.objects.case, 'in', _self.settings.speedIn); _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); break; case 'elastic': if(_self.objects.case.css('opacity') < 1){ _self.transition.zoom(_self.objects.case, 'in', _self.settings.speedIn); _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); } case 'fade': case 'fadeInline': _self.transition.fade(_self.objects.case, 'in', _self.settings.speedIn); _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); break; default: _self.transition.fade(_self.objects.case, 'in', 0); break; } _self._loading('end'); _self.isBusy=false; if(!_self.cache.firstOpened){ _self.cache.firstOpened=_self.objectData.this; } _self.objects.info.hide(); setTimeout(function (){ _self.transition.fade(_self.objects.info, 'in', _self.settings.speedIn); }, _self.settings.speedIn); }, _processContent: function (){ _self.isBusy=true; _self.transition.fade(_self.objects.info, 'out', 0); switch (_self.settings.transitionOut){ case 'scrollTop': case 'scrollRight': case 'scrollBottom': case 'scrollLeft': case 'scrollVertical': case 'scrollHorizontal': if(_self.objects.case.is(':hidden')){ _self.transition.fade(_self.objects.contentInner, 'out', 0); _self.transition.fade(_self.objects.case, 'out', 0, 0, function (){ _self._loadContent(); }); }else{ _self.transition.scroll(_self.objects.case, 'out', _self.settings.speedOut, function (){ _self._loadContent(); }); } break; case 'fade': if(_self.objects.case.is(':hidden')){ _self.transition.fade(_self.objects.case, 'out', 0, 0, function (){ _self._loadContent(); }); }else{ _self.transition.fade(_self.objects.case, 'out', _self.settings.speedOut, 0, function (){ _self._loadContent(); }); } break; case 'fadeInline': case 'elastic': if(_self.objects.case.is(':hidden')){ _self.transition.fade(_self.objects.case, 'out', 0, 0, function (){ _self._loadContent(); }); }else{ _self.transition.fade(_self.objects.contentInner, 'out', _self.settings.speedOut, 0, function (){ _self._loadContent(); }); } break; default: _self.transition.fade(_self.objects.case, 'out', 0, 0, function (){ _self._loadContent(); }); break; }}, _handleEvents: function (){ _self._unbindEvents(); _self.objects.nav.children().not(_self.objects.close).hide(); if(_self.isSlideshowEnabled()){ if((_self.settings.slideshowAutoStart===true||_self.isSlideshowStarted) && !_self.objects.nav.hasClass(_self.settings.classPrefix + 'paused') ){ _self._startTimeout(); }else{ _self._stopTimeout(); }} if(_self.settings.liveResize){ _self._watchResizeInteraction(); } _self.objects.close.click(function (event){ event.preventDefault(); _self.close(); }); if(_self.settings.closeOnOverlayClick===true){ _self.objects.overlay.css('cursor', 'pointer').click(function (event){ event.preventDefault(); _self.close(); }); } if(_self.settings.useKeys===true){ _self._addKeyEvents(); } if(_self.objectData.isPartOfSequence){ _self.objects.nav.attr(_self._prefixAttributeName('ispartofsequence'), true); _self.objects.nav.data('items', _self._setNavigation()); _self.objects.prev.click(function (event){ event.preventDefault(); if(_self.settings.navigateEndless===true||!_self.item.isFirst()){ _self.objects.prev.unbind('click'); _self.cache.action='prev'; _self.objects.nav.data('items').prev.click(); if(_self.isSlideshowEnabled()){ _self._stopTimeout(); }} }); _self.objects.next.click(function (event){ event.preventDefault(); if(_self.settings.navigateEndless===true||!_self.item.isLast()){ _self.objects.next.unbind('click'); _self.cache.action='next'; _self.objects.nav.data('items').next.click(); if(_self.isSlideshowEnabled()){ _self._stopTimeout(); }} }); if(_self.isSlideshowEnabled()){ _self.objects.play.click(function (event){ event.preventDefault(); _self._startTimeout(); }); _self.objects.pause.click(function (event){ event.preventDefault(); _self._stopTimeout(); }); } if(_self.settings.swipe===true){ if($.isPlainObject($.event.special.swipeleft)){ _self.objects.case.on('swipeleft', function (event){ event.preventDefault(); _self.objects.next.click(); if(_self.isSlideshowEnabled()){ _self._stopTimeout(); }}); } if($.isPlainObject($.event.special.swiperight)){ _self.objects.case.on('swiperight', function (event){ event.preventDefault(); _self.objects.prev.click(); if(_self.isSlideshowEnabled()){ _self._stopTimeout(); }}); }} }}, _addKeyEvents: function (){ $(document).bind('keyup.lightcase', function (event){ if(_self.isBusy){ return; } switch (event.keyCode){ case 27: _self.objects.close.click(); break; case 37: if(_self.objectData.isPartOfSequence){ _self.objects.prev.click(); } break; case 39: if(_self.objectData.isPartOfSequence){ _self.objects.next.click(); } break; }}); }, _startTimeout: function (){ _self.isSlideshowStarted=true; _self.objects.play.hide(); _self.objects.pause.show(); _self.cache.action='next'; _self.objects.nav.removeClass(_self.settings.classPrefix + 'paused'); _self.timeout=setTimeout(function (){ _self.objects.nav.data('items').next.click(); }, _self.settings.timeout); }, _stopTimeout: function (){ _self.objects.play.show(); _self.objects.pause.hide(); _self.objects.nav.addClass(_self.settings.classPrefix + 'paused'); clearTimeout(_self.timeout); }, _setNavigation: function (){ var $links=$((_self.cache.selector||_self.settings.attr)), sequenceLength=_self.objectData.sequenceLength - 1, items={ prev: $links.eq(_self.objectData.prevIndex), next: $links.eq(_self.objectData.nextIndex) }; if(_self.objectData.currentIndex > 0){ _self.objects.prev.show(); }else{ items.prevItem=$links.eq(sequenceLength); } if(_self.objectData.nextIndex <=sequenceLength){ _self.objects.next.show(); }else{ items.next=$links.eq(0); } if(_self.settings.navigateEndless===true){ _self.objects.prev.show(); _self.objects.next.show(); } return items; }, item: { isFirst: function (){ return (_self.objectData.currentIndex===0); }, isFirstOpened: function (){ return _self.objectData.this.is(_self.cache.firstOpened); }, isLast: function (){ return (_self.objectData.currentIndex===(_self.objectData.sequenceLength - 1)); }}, _cloneObject: function ($object){ var $clone=$object.clone(), objectId=$object.attr('id'); if($object.is(':hidden')){ _self._cacheObjectData($object); $object.attr('id', _self.settings.idPrefix + 'temp-' + objectId).empty(); }else{ $clone.removeAttr('id'); } return $clone.show(); }, isMobileDevice: function (){ var deviceAgent=navigator.userAgent.toLowerCase(), agentId=deviceAgent.match(_self.settings.mobileMatchExpression); return agentId ? true:false; }, isTransitionSupported: function (){ var body=_self.objects.body.get(0), isTransitionSupported=false, transitionMapping={ 'transition': '', 'WebkitTransition': '-webkit-', 'MozTransition': '-moz-', 'OTransition': '-o-', 'MsTransition': '-ms-' }; for (var key in transitionMapping){ if(transitionMapping.hasOwnProperty(key)&&key in body.style){ _self.support.transition=transitionMapping[key]; isTransitionSupported=true; }} return isTransitionSupported; }, transition: { in: function (){ if(_self.settings.transitionOpen&&!_self.cache.firstOpened){ return _self.settings.transitionOpen; } return _self.settings.transitionIn; }, fade: function ($object, type, speed, opacity, callback){ var isInTransition=type==='in', startTransition={}, startOpacity=$object.css('opacity'), endTransition={}, endOpacity=opacity ? opacity: isInTransition ? 1:0; if(!_self.isOpen&&isInTransition) return; startTransition['opacity']=startOpacity; endTransition['opacity']=endOpacity; $object.css(startTransition).show(); if(_self.support.transitions){ endTransition[_self.support.transition + 'transition']=speed + 'ms ease'; setTimeout(function (){ $object.css(endTransition); setTimeout(function (){ $object.css(_self.support.transition + 'transition', ''); if(callback&&(_self.isOpen||!isInTransition)){ callback(); }}, speed); }, 15); }else{ $object.stop(); $object.animate(endTransition, speed, callback); }}, scroll: function ($object, type, speed, callback){ var isInTransition=type==='in', transition=isInTransition ? _self.settings.transitionIn:_self.settings.transitionOut, direction='left', startTransition={}, startOpacity=isInTransition ? 0:1, startOffset=isInTransition ? '-50%':'50%', endTransition={}, endOpacity=isInTransition ? 1:0, endOffset=isInTransition ? '50%':'-50%'; if(!_self.isOpen&&isInTransition) return; switch (transition){ case 'scrollTop': direction='top'; break; case 'scrollRight': startOffset=isInTransition ? '150%':'50%'; endOffset=isInTransition ? '50%':'150%'; break; case 'scrollBottom': direction='top'; startOffset=isInTransition ? '150%':'50%'; endOffset=isInTransition ? '50%':'150%'; break; case 'scrollHorizontal': startOffset=isInTransition ? '150%':'50%'; endOffset=isInTransition ? '50%':'-50%'; break; case 'scrollVertical': direction='top'; startOffset=isInTransition ? '-50%':'50%'; endOffset=isInTransition ? '50%':'150%'; break; } if(_self.cache.action==='prev'){ switch (transition){ case 'scrollHorizontal': startOffset=isInTransition ? '-50%':'50%'; endOffset=isInTransition ? '50%':'150%'; break; case 'scrollVertical': startOffset=isInTransition ? '150%':'50%'; endOffset=isInTransition ? '50%':'-50%'; break; }} startTransition['opacity']=startOpacity; startTransition[direction]=startOffset; endTransition['opacity']=endOpacity; endTransition[direction]=endOffset; $object.css(startTransition).show(); if(_self.support.transitions){ endTransition[_self.support.transition + 'transition']=speed + 'ms ease'; setTimeout(function (){ $object.css(endTransition); setTimeout(function (){ $object.css(_self.support.transition + 'transition', ''); if(callback&&(_self.isOpen||!isInTransition)){ callback(); }}, speed); }, 15); }else{ $object.stop(); $object.animate(endTransition, speed, callback); }}, zoom: function ($object, type, speed, callback){ var isInTransition=type==='in', startTransition={}, startOpacity=$object.css('opacity'), startScale=isInTransition ? 'scale(0.75)':'scale(1)', endTransition={}, endOpacity=isInTransition ? 1:0, endScale=isInTransition ? 'scale(1)':'scale(0.75)'; if(!_self.isOpen&&isInTransition) return; startTransition['opacity']=startOpacity; startTransition[_self.support.transition + 'transform']=startScale; endTransition['opacity']=endOpacity; $object.css(startTransition).show(); if(_self.support.transitions){ endTransition[_self.support.transition + 'transform']=endScale; endTransition[_self.support.transition + 'transition']=speed + 'ms ease'; setTimeout(function (){ $object.css(endTransition); setTimeout(function (){ $object.css(_self.support.transition + 'transform', ''); $object.css(_self.support.transition + 'transition', ''); if(callback&&(_self.isOpen||!isInTransition)){ callback(); }}, speed); }, 15); }else{ $object.stop(); $object.animate(endTransition, speed, callback); }} }, _callHooks: function (hooks){ if(typeof(hooks)==='object'){ $.each(hooks, function(index, hook){ if(typeof(hook)==='function'){ hook.call(_self.origin); }}); }}, _cacheObjectData: function ($object){ $.data($object, 'cache', { id: $object.attr('id'), content: $object.html() }); _self.cache.originalObject=$object; }, _restoreObject: function (){ var $object=$('[id^="' + _self.settings.idPrefix + 'temp-"]'); $object.attr('id', $.data(_self.cache.originalObject, 'cache').id); $object.html($.data(_self.cache.originalObject, 'cache').content); }, resize: function (){ if(!_self.isOpen) return; if(_self.isSlideshowEnabled()){ _self._stopTimeout(); } _self.dimensions=_self.getViewportDimensions(); _self._calculateDimensions(_self.cache.object); _self._callHooks(_self.settings.onResize); }, _watchResizeInteraction: function (){ $(window).resize(_self.resize); }, _unwatchResizeInteraction: function (){ $(window).off('resize', _self.resize); }, _switchToFullScreenMode: function (){ _self.settings.shrinkFactor=1; _self.settings.overlayOpacity=1; $('html').addClass(_self.settings.classPrefix + 'fullScreenMode'); }, _open: function (){ _self.isOpen=true; _self.support.transitions=_self.settings.cssTransitions ? _self.isTransitionSupported():false; _self.support.mobileDevice=_self.isMobileDevice(); if(_self.support.mobileDevice){ $('html').addClass(_self.settings.classPrefix + 'isMobileDevice'); if(_self.settings.fullScreenModeForMobile){ _self._switchToFullScreenMode(); }} if(!_self.settings.transitionIn){ _self.settings.transitionIn=_self.settings.transition; } if(!_self.settings.transitionOut){ _self.settings.transitionOut=_self.settings.transition; } switch (_self.transition.in()){ case 'fade': case 'fadeInline': case 'elastic': case 'scrollTop': case 'scrollRight': case 'scrollBottom': case 'scrollLeft': case 'scrollVertical': case 'scrollHorizontal': if(_self.objects.case.is(':hidden')){ _self.objects.close.css('opacity', 0); _self.objects.overlay.css('opacity', 0); _self.objects.case.css('opacity', 0); _self.objects.contentInner.css('opacity', 0); } _self.transition.fade(_self.objects.overlay, 'in', _self.settings.speedIn, _self.settings.overlayOpacity, function (){ _self.transition.fade(_self.objects.close, 'in', _self.settings.speedIn); _self._handleEvents(); _self._processContent(); }); break; default: _self.transition.fade(_self.objects.overlay, 'in', 0, _self.settings.overlayOpacity, function (){ _self.transition.fade(_self.objects.close, 'in', 0); _self._handleEvents(); _self._processContent(); }); break; } _self.objects.document.addClass(_self.settings.classPrefix + 'open'); _self.objects.case.attr('aria-hidden', 'false'); }, close: function (){ _self.isOpen=false; if(_self.isSlideshowEnabled()){ _self._stopTimeout(); _self.isSlideshowStarted=false; _self.objects.nav.removeClass(_self.settings.classPrefix + 'paused'); } _self.objects.loading.hide(); _self._unbindEvents(); _self._unwatchResizeInteraction(); $('html').removeClass(_self.settings.classPrefix + 'open'); _self.objects.case.attr('aria-hidden', 'true'); _self.objects.nav.children().hide(); _self.objects.close.hide(); _self._callHooks(_self.settings.onClose); _self.transition.fade(_self.objects.info, 'out', 0); switch (_self.settings.transitionClose||_self.settings.transitionOut){ case 'fade': case 'fadeInline': case 'scrollTop': case 'scrollRight': case 'scrollBottom': case 'scrollLeft': case 'scrollHorizontal': case 'scrollVertical': _self.transition.fade(_self.objects.case, 'out', _self.settings.speedOut, 0, function (){ _self.transition.fade(_self.objects.overlay, 'out', _self.settings.speedOut, 0, function (){ _self.cleanup(); }); }); break; case 'elastic': _self.transition.zoom(_self.objects.case, 'out', _self.settings.speedOut, function (){ _self.transition.fade(_self.objects.overlay, 'out', _self.settings.speedOut, 0, function (){ _self.cleanup(); }); }); break; default: _self.cleanup(); break; }}, _unbindEvents: function (){ _self.objects.overlay.unbind('click'); $(document).unbind('keyup.lightcase'); _self.objects.case.unbind('swipeleft').unbind('swiperight'); _self.objects.prev.unbind('click'); _self.objects.next.unbind('click'); _self.objects.play.unbind('click'); _self.objects.pause.unbind('click'); _self.objects.close.unbind('click'); }, _cleanupDimensions: function (){ var opacity=_self.objects.contentInner.css('opacity'); _self.objects.case.css({ 'width': '', 'height': '', 'top': '', 'left': '', 'margin-top': '', 'margin-left': '' }); _self.objects.contentInner.removeAttr('style').css('opacity', opacity); _self.objects.contentInner.children().removeAttr('style'); }, cleanup: function (){ _self._cleanupDimensions(); _self.objects.loading.hide(); _self.objects.overlay.hide(); _self.objects.case.hide(); _self.objects.prev.hide(); _self.objects.next.hide(); _self.objects.play.hide(); _self.objects.pause.hide(); _self.objects.document.removeAttr(_self._prefixAttributeName('type')); _self.objects.nav.removeAttr(_self._prefixAttributeName('ispartofsequence')); _self.objects.contentInner.empty().hide(); _self.objects.info.children().empty(); if(_self.cache.originalObject){ _self._restoreObject(); } _self._callHooks(_self.settings.onCleanup); _self.cache={};}, _matchMedia: function (){ return window.matchMedia||window.msMatchMedia; }, _devicePixelRatio: function (){ return window.devicePixelRatio||1; }, _isPublicMethod: function (method){ return (typeof _self[method]==='function'&&method.charAt(0)!=='_'); }, _export: function (){ window.lightcase={}; $.each(_self, function (property){ if(_self._isPublicMethod(property)){ lightcase[property]=_self[property]; }}); }}; _self._export(); $.fn.lightcase=function (method){ if(_self._isPublicMethod(method)){ return _self[method].apply(this, Array.prototype.slice.call(arguments, 1)); }else if(typeof method==='object'||!method){ return _self.init.apply(this, arguments); }else{ $.error('Method ' + method + ' does not exist on jQuery.lightcase'); }};})(jQuery); (function (window){ 'use strict'; if(!Date.now){ Date.now=function (){ return new Date().getTime(); };} if(!window.requestAnimationFrame){ (function (){ var vendors=['webkit', 'moz']; for (var i=0; i < vendors.length&&!window.requestAnimationFrame; ++i){ var vp=vendors[i]; window.requestAnimationFrame=window[vp+'RequestAnimationFrame']; window.cancelAnimationFrame=window[vp+'CancelAnimationFrame'] || window[vp+'CancelRequestAnimationFrame']; } if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame||!window.cancelAnimationFrame){ var lastTime=0; window.requestAnimationFrame=function (callback){ var now=Date.now(); var nextTime=Math.max(lastTime + 16, now); return setTimeout(function (){ callback(lastTime=nextTime); }, nextTime - now); }; window.cancelAnimationFrame=clearTimeout; }}()); } var supportTransform=(function (){ if(!window.getComputedStyle){ return false; } var el=document.createElement('p'), has3d, transforms={ 'webkitTransform':'-webkit-transform', 'OTransform':'-o-transform', 'msTransform':'-ms-transform', 'MozTransform':'-moz-transform', 'transform':'transform' }; (document.body||document.documentElement).insertBefore(el, null); for (var t in transforms){ if(typeof el.style[t]!=='undefined'){ el.style[t]="translate3d(1px,1px,1px)"; has3d=window.getComputedStyle(el).getPropertyValue(transforms[t]); }} (document.body||document.documentElement).removeChild(el); return typeof has3d!=='undefined'&&has3d.length > 0&&has3d!=="none"; }()); var isAndroid=navigator.userAgent.toLowerCase().indexOf('android') > -1; var isIOs=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream; var isOperaOld = !!window.opera; var isEdge=/Edge\/\d+/.test(navigator.userAgent); var isIE11=/Trident.*rv[ :]*11\./.test(navigator.userAgent); var isIE10 = !!Function('/*@cc_on return document.documentMode===10@*/')(); var isIElt10=document.all&&!window.atob; var wndW; var wndH; function updateWndVars (){ wndW=window.innerWidth||document.documentElement.clientWidth; wndH=window.innerHeight||document.documentElement.clientHeight; } updateWndVars(); var jarallaxList=[]; var Jarallax=(function (){ var instanceID=0; function Jarallax_inner (item, userOptions){ var _this=this, dataOptions; _this.$item=item; _this.defaults={ type:'scroll', speed:0.5, imgSrc:null, imgWidth:null, imgHeight:null, enableTransform:true, zIndex:-100, noAdnroid:false, noIos:true, onScroll:null, onInit:null, onDestroy:null, onCoverImage:null }; dataOptions=JSON.parse(_this.$item.getAttribute('data-jarallax')||'{}'); _this.options=_this.extend({}, _this.defaults, dataOptions, userOptions); if(isAndroid&&_this.options.noAdnroid||isIOs&&_this.options.noIos){ return; } _this.options.speed=Math.min(2, Math.max(-1, parseFloat(_this.options.speed))); _this.instanceID=instanceID++; _this.image={ src:_this.options.imgSrc||null, $container:null, $item:null, width:_this.options.imgWidth||null, height:_this.options.imgHeight||null, useImgTag:isIOs||isAndroid||isOperaOld||isIE11||isIE10||isEdge }; if(_this.initImg()){ _this.init(); }} return Jarallax_inner; }()); Jarallax.prototype.css=function (el, styles){ if(typeof styles==='string'){ if(window.getComputedStyle){ return window.getComputedStyle(el).getPropertyValue(styles); } return el.style[styles]; } if(styles.transform){ styles.WebkitTransform=styles.MozTransform=styles.transform; } for(var k in styles){ el.style[k]=styles[k]; } return el; }; Jarallax.prototype.extend=function (out){ out=out||{}; for (var i=1; i < arguments.length; i++){ if(!arguments[i]){ continue; } for (var key in arguments[i]){ if(arguments[i].hasOwnProperty(key)){ out[key]=arguments[i][key]; }} } return out; }; Jarallax.prototype.initImg=function (){ var _this=this; if(_this.image.src===null){ _this.image.src=_this.css(_this.$item, 'background-image').replace(/^url\(['"]?/g,'').replace(/['"]?\)$/g,''); } if(!_this.image.src||_this.image.src==='none'){ return false; } return true; }; Jarallax.prototype.init=function (){ var _this=this, containerStyles={ position:'absolute', top:0, left:0, width:'100%', height:'100%', overflow:'hidden', pointerEvents:'none' }, imageStyles={ position:'fixed' }; _this.image.$container=document.createElement('div'); _this.css(_this.image.$container, containerStyles); _this.css(_this.image.$container, { visibility:'hidden', 'z-index':_this.options.zIndex }); _this.image.$container.setAttribute('id', 'jarallax-container-' + _this.instanceID); _this.$item.appendChild(_this.image.$container); if(_this.image.useImgTag&&supportTransform&&_this.options.enableTransform){ _this.image.$item=document.createElement('img'); _this.image.$item.setAttribute('src', _this.image.src); imageStyles=_this.extend({ 'max-width':'none' }, containerStyles, imageStyles); }else{ _this.image.$item=document.createElement('div'); imageStyles=_this.extend({ 'background-position':'50% 50%', 'background-size':'100% auto', 'background-repeat':'no-repeat no-repeat', 'background-image':'url("' + _this.image.src + '")' }, containerStyles, imageStyles); } if(isIElt10){ imageStyles.backgroundAttachment='fixed'; } _this.parentWithTransform=0; var $itemParents=_this.$item; while ($itemParents!==null&&$itemParents!==document&&_this.parentWithTransform===0){ if(_this.css($itemParents, '-webkit-transform')||_this.css($itemParents, '-moz-transform')||_this.css($itemParents, 'transform')){ _this.parentWithTransform=1; _this.css(_this.image.$container, { transform: 'translateX(0) translateY(0)' }); } $itemParents=$itemParents.parentNode; } _this.css(_this.image.$item, imageStyles); _this.image.$container.appendChild(_this.image.$item); function initAfterReady (){ _this.coverImage(); _this.clipContainer(); _this.onScroll(true); _this.$item.setAttribute('data-jarallax-original-styles', _this.$item.getAttribute('style')); if(_this.options.onInit){ _this.options.onInit.call(_this); } setTimeout(function (){ if(_this.$item){ _this.css(_this.$item, { 'background-image':'none', 'background-attachment':'scroll', 'background-size':'auto' }); }}, 0); } if(_this.image.width&&_this.image.height){ initAfterReady(); }else{ _this.getImageSize(_this.image.src, function (width, height){ _this.image.width=width; _this.image.height=height; initAfterReady(); }); } jarallaxList.push(_this); }; Jarallax.prototype.destroy=function (){ var _this=this; for(var k=0, len=jarallaxList.length; k < len; k++){ if(jarallaxList[k].instanceID===_this.instanceID){ jarallaxList.splice(k, 1); break; }} _this.$item.setAttribute('style', _this.$item.getAttribute('data-jarallax-original-styles')); _this.$item.removeAttribute('data-jarallax-original-styles'); if(_this.$clipStyles){ _this.$clipStyles.parentNode.removeChild(_this.$clipStyles); } _this.image.$container.parentNode.removeChild(_this.image.$container); if(_this.options.onDestroy){ _this.options.onDestroy.call(_this); } delete _this.$item.jarallax; for(var n in _this){ delete _this[n]; }}; Jarallax.prototype.getImageSize=function (src, callback){ if(!src||!callback){ return; } var tempImg=new Image(); tempImg.onload=function (){ callback(tempImg.width, tempImg.height); }; tempImg.src=src; }; Jarallax.prototype.clipContainer=function (){ if(isIElt10){ return; } var _this=this, rect=_this.image.$container.getBoundingClientRect(), width=rect.width, height=rect.height; if(!_this.$clipStyles){ _this.$clipStyles=document.createElement('style'); _this.$clipStyles.setAttribute('type', 'text/css'); _this.$clipStyles.setAttribute('id', '#jarallax-clip-' + _this.instanceID); var head=document.head||document.getElementsByTagName('head')[0]; head.appendChild(_this.$clipStyles); } var styles=[ '#jarallax-container-' + _this.instanceID + ' {', ' clip: rect(0 ' + width + 'px ' + height + 'px 0);', ' clip: rect(0, ' + width + 'px, ' + height + 'px, 0);', '}' ].join('\n'); if(_this.$clipStyles.styleSheet){ _this.$clipStyles.styleSheet.cssText=styles; }else{ _this.$clipStyles.innerHTML=styles; }}; Jarallax.prototype.coverImage=function (){ var _this=this; if(!_this.image.width||!_this.image.height){ return; } var rect=_this.image.$container.getBoundingClientRect(), contW=rect.width, contH=rect.height, contL=rect.left, imgW=_this.image.width, imgH=_this.image.height, speed=_this.options.speed, isScroll=_this.options.type==='scroll'||_this.options.type==='scroll-opacity', scrollDist=0, resultW=0, resultH=contH, resultML=0, resultMT=0; if(isScroll){ scrollDist=speed * (contH + wndH) / 2; if(speed < 0||speed > 1){ scrollDist=speed * Math.max(contH, wndH) / 2; } if(speed < 0||speed > 1){ resultH=Math.max(contH, wndH) + Math.abs(scrollDist) * 2; }else{ resultH +=Math.abs(wndH - contH) * (1 - speed); }} resultW=resultH * imgW / imgH; if(resultW < contW){ resultW=contW; resultH=resultW * imgH / imgW; } _this.bgPosVerticalCenter=0; if(isScroll&&resultH < wndH&&(!supportTransform||!_this.options.enableTransform)){ _this.bgPosVerticalCenter=(wndH - resultH) / 2; resultH=wndH; } if(isScroll){ resultML=contL + (contW - resultW) / 2; resultMT=(wndH - resultH) / 2; }else{ resultML=(contW - resultW) / 2; resultMT=(contH - resultH) / 2; } if(_this.parentWithTransform){ resultML -=contL; } _this.parallaxScrollDistance=scrollDist; _this.css(_this.image.$item, { width: resultW + 'px', height: resultH + 'px', marginLeft: resultML + 'px', marginTop: resultMT + 'px' }); if(_this.options.onCoverImage){ _this.options.onCoverImage.call(_this); }}; Jarallax.prototype.isVisible=function (){ return this.isElementInViewport||false; }; Jarallax.prototype.onScroll=function (force){ var _this=this; if(!_this.image.width||!_this.image.height){ return; } var rect=_this.$item.getBoundingClientRect(), contT=rect.top, contH=rect.height, styles={ position:'absolute', visibility:'visible', backgroundPosition:'50% 50%' }; _this.isElementInViewport = rect.bottom >=0 && rect.right >=0 && contT <=wndH && rect.left <=wndW; var check=force ? false:!_this.isElementInViewport; if(check){ return; } var beforeTop=Math.max(0, contT), beforeTopEnd=Math.max(0, contH + contT), afterTop=Math.max(0, -contT), beforeBottom=Math.max(0, contT + contH - wndH), beforeBottomEnd=Math.max(0, contH - (contT + contH - wndH)), afterBottom=Math.max(0, -contT + wndH - contH), fromViewportCenter=1 - 2 * (wndH - contT) / (wndH + contH); var visiblePercent=1; if(contH < wndH){ visiblePercent=1 - (afterTop||beforeBottom) / contH; }else{ if(beforeTopEnd <=wndH){ visiblePercent=beforeTopEnd / wndH; }else if(beforeBottomEnd <=wndH){ visiblePercent=beforeBottomEnd / wndH; }} if(_this.options.type==='opacity'||_this.options.type==='scale-opacity'||_this.options.type==='scroll-opacity'){ styles.transform='translate3d(0, 0, 0)'; styles.opacity=visiblePercent; } if(_this.options.type==='scale'||_this.options.type==='scale-opacity'){ var scale=1; if(_this.options.speed < 0){ scale -=_this.options.speed * visiblePercent; }else{ scale +=_this.options.speed * (1 - visiblePercent); } styles.transform='scale(' + scale + ') translate3d(0, 0, 0)'; } if(_this.options.type==='scroll'||_this.options.type==='scroll-opacity'){ var positionY=_this.parallaxScrollDistance * fromViewportCenter; if(supportTransform&&_this.options.enableTransform){ if(_this.parentWithTransform){ positionY -=contT; } styles.transform='translate3d(0, ' + positionY + 'px, 0)'; }else{ if(_this.bgPosVerticalCenter){ positionY +=_this.bgPosVerticalCenter; } styles.backgroundPosition='50% ' + positionY + 'px'; } styles.position=isIElt10 ? 'absolute':'fixed'; } _this.css(_this.image.$item, styles); if(_this.options.onScroll){ _this.options.onScroll.call(_this, { section: rect, beforeTop: beforeTop, beforeTopEnd: beforeTopEnd, afterTop: afterTop, beforeBottom: beforeBottom, beforeBottomEnd: beforeBottomEnd, afterBottom: afterBottom, visiblePercent: visiblePercent, fromViewportCenter: fromViewportCenter }); }}; function addEventListener (el, eventName, handler){ if(el.addEventListener){ el.addEventListener(eventName, handler); }else{ el.attachEvent('on' + eventName, function (){ handler.call(el); }); }} function update (e){ window.requestAnimationFrame(function (){ if(e.type!=='scroll'){ updateWndVars(); } for(var k=0, len=jarallaxList.length; k < len; k++){ if(e.type!=='scroll'){ jarallaxList[k].coverImage(); jarallaxList[k].clipContainer(); } jarallaxList[k].onScroll(); }}); } addEventListener(window, 'scroll', update); addEventListener(window, 'resize', update); addEventListener(window, 'orientationchange', update); addEventListener(window, 'load', update); var plugin=function (items){ if(typeof HTMLElement==="object" ? items instanceof HTMLElement:items&&typeof items==="object"&&items!==null&&items.nodeType===1&&typeof items.nodeName==="string"){ items=[items]; } var options=arguments[1], args=Array.prototype.slice.call(arguments, 2), len=items.length, k=0, ret; for (k; k < len; k++){ if(typeof options==='object'||typeof options==='undefined'){ if(!items[k].jarallax){ items[k].jarallax=new Jarallax(items[k], options); }} else if(items[k].jarallax){ ret=items[k].jarallax[options].apply(items[k].jarallax, args); } if(typeof ret!=='undefined'){ return ret; }} return items; }; plugin.constructor=Jarallax; var oldPlugin=window.jarallax; window.jarallax=plugin; window.jarallax.noConflict=function (){ window.jarallax=oldPlugin; return this; }; if(typeof jQuery!=='undefined'){ var jQueryPlugin=function (){ var args=arguments||[]; Array.prototype.unshift.call(args, this); var res=plugin.apply(window, args); return typeof res!=='object' ? res:this; }; jQueryPlugin.constructor=Jarallax; var oldJqPlugin=jQuery.fn.jarallax; jQuery.fn.jarallax=jQueryPlugin; jQuery.fn.jarallax.noConflict=function (){ jQuery.fn.jarallax=oldJqPlugin; return this; };} addEventListener(window, 'DOMContentLoaded', function (){ plugin(document.querySelectorAll('[data-jarallax]')); }); }(window)); !function(a,b,c){function d(a,c){var d=b(a);d.data(f,this),this._$element=d,this.shares=[],this._init(c),this._render()}var e="JSSocials",f=e,g=function(a,c){return b.isFunction(a)?a.apply(c,b.makeArray(arguments).slice(2)):a},h=/(\.(jpeg|png|gif|bmp|svg)$|^data:image\/(jpeg|png|gif|bmp|svg\+xml);base64)/i,i=/(&?[a-zA-Z0-9]+=)?\{([a-zA-Z0-9]+)\}/g,j={G:1e9,M:1e6,K:1e3},k={};d.prototype={url:"",text:"",shareIn:"blank",showLabel:function(a){return this.showCount===!1?a>this.smallScreenWidth:a>=this.largeScreenWidth},showCount:function(a){return a<=this.smallScreenWidth?"inside":!0},smallScreenWidth:640,largeScreenWidth:1024,resizeTimeout:200,elementClass:"jssocials",sharesClass:"jssocials-shares",shareClass:"jssocials-share",shareButtonClass:"jssocials-share-button",shareLinkClass:"jssocials-share-link",shareLogoClass:"jssocials-share-logo",shareLabelClass:"jssocials-share-label",shareLinkCountClass:"jssocials-share-link-count",shareCountBoxClass:"jssocials-share-count-box",shareCountClass:"jssocials-share-count",shareZeroCountClass:"jssocials-share-no-count",_init:function(a){this._initDefaults(),b.extend(this,a),this._initShares(),this._attachWindowResizeCallback()},_initDefaults:function(){this.url=a.location.href,this.text=b.trim(b("meta[name=description]").attr("content")||b("title").text())},_initShares:function(){this.shares=b.map(this.shares,b.proxy(function(a){"string"==typeof a&&(a={share:a});var c=a.share&&k[a.share];if(!c&&!a.renderer)throw Error("Share '"+a.share+"' is not found");return b.extend({url:this.url,text:this.text},c,a)},this))},_attachWindowResizeCallback:function(){b(a).on("resize",b.proxy(this._windowResizeHandler,this))},_detachWindowResizeCallback:function(){b(a).off("resize",this._windowResizeHandler)},_windowResizeHandler:function(){(b.isFunction(this.showLabel)||b.isFunction(this.showCount))&&(a.clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(b.proxy(this.refresh,this),this.resizeTimeout))},_render:function(){this._clear(),this._defineOptionsByScreen(),this._$element.addClass(this.elementClass),this._$shares=b("
").addClass(this.sharesClass).appendTo(this._$element),this._renderShares()},_defineOptionsByScreen:function(){this._screenWidth=b(a).width(),this._showLabel=g(this.showLabel,this,this._screenWidth),this._showCount=g(this.showCount,this,this._screenWidth)},_renderShares:function(){b.each(this.shares,b.proxy(function(a,b){this._renderShare(b)},this))},_renderShare:function(a){var c;c=b.isFunction(a.renderer)?b(a.renderer()):this._createShare(a),c.addClass(this.shareClass).addClass(a.share?"jssocials-share-"+a.share:"").addClass(a.css).appendTo(this._$shares)},_createShare:function(a){var c=b("
"),d=this._createShareLink(a).appendTo(c);if(this._showCount){var e="inside"===this._showCount,f=e?d:b("
").addClass(this.shareCountBoxClass).appendTo(c);f.addClass(e?this.shareLinkCountClass:this.shareCountBoxClass),this._renderShareCount(a,f)}return c},_createShareLink:function(a){var c=this._getShareStrategy(a),d=c.call(a,{shareUrl:this._getShareUrl(a)});return d.addClass(this.shareLinkClass).append(this._createShareLogo(a)),this._showLabel&&d.append(this._createShareLabel(a)),b.each(this.on||{},function(c,e){b.isFunction(e)&&d.on(c,b.proxy(e,a))}),d},_getShareStrategy:function(a){var b=m[a.shareIn||this.shareIn];if(!b)throw Error("Share strategy '"+this.shareIn+"' not found");return b},_getShareUrl:function(a){var b=g(a.shareUrl,a);return this._formatShareUrl(b,a)},_createShareLogo:function(a){var c=a.logo,d=h.test(c)?b("").attr("src",a.logo):b("").addClass(c);return d.addClass(this.shareLogoClass),d},_createShareLabel:function(a){return b("").addClass(this.shareLabelClass).text(a.label)},_renderShareCount:function(a,c){var d=b("").addClass(this.shareCountClass);c.addClass(this.shareZeroCountClass).append(d),this._loadCount(a).done(b.proxy(function(a){a&&(c.removeClass(this.shareZeroCountClass),d.text(a))},this))},_loadCount:function(a){var c=b.Deferred(),d=this._getCountUrl(a);if(!d)return c.resolve(0).promise();var e=b.proxy(function(b){c.resolve(this._getCountValue(b,a))},this);return b.getJSON(d).done(e).fail(function(){b.get(d).done(e).fail(function(){c.resolve(0)})}),c.promise()},_getCountUrl:function(a){var b=g(a.countUrl,a);return this._formatShareUrl(b,a)},_getCountValue:function(a,c){var d=(b.isFunction(c.getCount)?c.getCount(a):a)||0;return"string"==typeof d?d:this._formatNumber(d)},_formatNumber:function(a){return b.each(j,function(b,c){return a>=c?(a=parseFloat((a/c).toFixed(2))+b,!1):void 0}),a},_formatShareUrl:function(b,c){return b.replace(i,function(b,d,e){var f=c[e]||"";return f?(d||"")+a.encodeURIComponent(f):""})},_clear:function(){a.clearTimeout(this._resizeTimer),this._$element.empty()},_passOptionToShares:function(a,c){var d=this.shares;b.each(["url","text"],function(e,f){f===a&&b.each(d,function(b,d){d[a]=c})})},_normalizeShare:function(a){return b.isNumeric(a)?this.shares[a]:"string"==typeof a?b.grep(this.shares,function(b){return b.share===a})[0]:a},refresh:function(){this._render()},destroy:function(){this._clear(),this._detachWindowResizeCallback(),this._$element.removeClass(this.elementClass).removeData(f)},option:function(a,b){return 1===arguments.length?this[a]:(this[a]=b,this._passOptionToShares(a,b),void this.refresh())},shareOption:function(a,b,c){return a=this._normalizeShare(a),2===arguments.length?a[b]:(a[b]=c,void this.refresh())}},b.fn.jsSocials=function(a){var e=b.makeArray(arguments),g=e.slice(1),h=this;return this.each(function(){var e,i=b(this),j=i.data(f);if(j)if("string"==typeof a){if(e=j[a].apply(j,g),e!==c&&e!==j)return h=e,!1}else j._detachWindowResizeCallback(),j._init(a),j._render();else new d(i,a)}),h};var l=function(a){var c;b.isPlainObject(a)?c=d.prototype:(c=k[a],a=arguments[1]||{}),b.extend(c,a)},m={popup:function(c){return b("").attr("href","#").on("click",function(){return a.open(c.shareUrl,null,"width=600, height=400, location=0, menubar=0, resizeable=0, scrollbars=0, status=0, titlebar=0, toolbar=0"),!1})},blank:function(a){return b("").attr({target:"_blank",href:a.shareUrl})},self:function(a){return b("").attr({target:"_self",href:a.shareUrl})}};a.jsSocials={Socials:d,shares:k,shareStrategies:m,setDefaults:l}}(window,jQuery),function(a,b,c){b.extend(c.shares,{email:{label:"E-mail",logo:"fa fa-at",shareUrl:"mailto:{to}?subject={text}&body={url}",countUrl:"",shareIn:"self"},twitter:{label:"Tweet",logo:"fa fa-twitter",shareUrl:"https://twitter.com/share?url={url}&text={text}&via={via}&hashtags={hashtags}",countUrl:""},facebook:{label:"Like",logo:"fa fa-facebook",shareUrl:"https://facebook.com/sharer/sharer.php?u={url}",countUrl:"https://graph.facebook.com/?id={url}",getCount:function(a){return a.share&&a.share.share_count||0}},vkontakte:{label:"Like",logo:"fa fa-vk",shareUrl:"https://vk.com/share.php?url={url}&title={title}&description={text}",countUrl:"https://vk.com/share.php?act=count&index=1&url={url}",getCount:function(a){return parseInt(a.slice(15,-2).split(", ")[1])}},googleplus:{label:"+1",logo:"fa fa-google",shareUrl:"https://plus.google.com/share?url={url}",countUrl:""},linkedin:{label:"Share",logo:"fa fa-linkedin",shareUrl:"https://www.linkedin.com/shareArticle?mini=true&url={url}",countUrl:"https://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?",getCount:function(a){return a.count}},pinterest:{label:"Pin it",logo:"fa fa-pinterest",shareUrl:"https://pinterest.com/pin/create/bookmarklet/?media={media}&url={url}&description={text}",countUrl:"https://api.pinterest.com/v1/urls/count.json?&url={url}&callback=?",getCount:function(a){return a.count}},stumbleupon:{label:"Share",logo:"fa fa-stumbleupon",shareUrl:"http://www.stumbleupon.com/submit?url={url}&title={title}",countUrl:"https://cors-anywhere.herokuapp.com/https://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}",getCount:function(a){return a.result.views}},telegram:{label:"Telegram",logo:"fa fa-paper-plane",shareUrl:"tg://msg?text={url} {text}",countUrl:"",shareIn:"self"},whatsapp:{label:"WhatsApp",logo:"fa fa-whatsapp",shareUrl:"whatsapp://send?text={url} {text}",countUrl:"",shareIn:"self"},line:{label:"LINE",logo:"fa fa-comment",shareUrl:"http://line.me/R/msg/text/?{text} {url}",countUrl:""},viber:{label:"Viber",logo:"fa fa-volume-control-phone",shareUrl:"viber://forward?text={url} {text}",countUrl:"",shareIn:"self"},pocket:{label:"Pocket",logo:"fa fa-get-pocket",shareUrl:"https://getpocket.com/save?url={url}&title={title}",countUrl:""},messenger:{label:"Share",logo:"fa fa-commenting",shareUrl:"fb-messenger://share?link={url}",countUrl:"",shareIn:"self"}})}(window,jQuery,window.jsSocials); (function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==n.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var o=0,s=r.length;s>o;o++){var a=r[o];a()}}}function o(o){return o.bind(n,"DOMContentLoaded",i),o.bind(n,"readystatechange",i),o.bind(t,"load",i),e}var n=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],o)):t.docReady=o(t.eventie)}(this),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t){function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function o(t){function o(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var o=r(t);if("none"===o.display)return i();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var h=n.isBorderBox=!(!p||!o[p]||"border-box"!==o[p]),f=0,c=s.length;c>f;f++){var d=s[f],l=o[d];l=a(t,l);var y=parseFloat(l);n[d]=isNaN(y)?0:y}var m=n.paddingLeft+n.paddingRight,g=n.paddingTop+n.paddingBottom,v=n.marginLeft+n.marginRight,_=n.marginTop+n.marginBottom,I=n.borderLeftWidth+n.borderRightWidth,L=n.borderTopWidth+n.borderBottomWidth,z=h&&u,S=e(o.width);S!==!1&&(n.width=S+(z?0:m+I));var b=e(o.height);return b!==!1&&(n.height=b+(z?0:g+L)),n.innerWidth=n.width-(m+I),n.innerHeight=n.height-(g+L),n.outerWidth=n.width+v,n.outerHeight=n.height+_,n}}function a(t,e){if(n||-1===e.indexOf("%"))return e;var i=t.style,o=i.left,r=t.runtimeStyle,s=r&&r.left;return s&&(r.left=t.currentStyle.left),i.left=e,e=i.pixelLeft,i.left=o,s&&(r.left=s),e}var u,p=t("boxSizing");return function(){if(p){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[p]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var o=r(t);u=200===e(o.width),i.removeChild(t)}}(),o}var n=t.getComputedStyle,r=n?function(t){return n(t,null)}:function(t){return t.currentStyle},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],o):"object"==typeof exports?module.exports=o(require("get-style-property")):t.getSize=o(t.getStyleProperty)}(window),function(t,e){function i(t,e){return t[a](e)}function o(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function n(t,e){o(t);for(var i=t.parentNode.querySelectorAll(e),n=0,r=i.length;r>n;n++)if(i[n]===t)return!0;return!1}function r(t,e){return o(t),i(t,e)}var s,a=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,o=t.length;o>i;i++){var n=t[i],r=n+"MatchesSelector";if(e[r])return r}}();if(a){var u=document.createElement("div"),p=i(u,"div");s=p?i:r}else s=n;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return s}):window.matchesSelector=s}(this,Element.prototype),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function n(t,n,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),p=r("transform"),h=u&&p,f=!!r("perspective"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],d=["transform","transition","transitionDuration","transitionProperty"],l=function(){for(var t={},e=0,i=d.length;i>e;e++){var o=d[e],n=r(o);n&&n!==o&&(t[o]=n)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getSize=function(){this.size=n(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=l[i]||i;e[o]=t[i]}},a.prototype.getPosition=function(){var t=s(this.element),e=this.layout.options,i=e.isOriginLeft,o=e.isOriginTop,n=parseInt(t[i?"left":"right"],10),r=parseInt(t[o?"top":"bottom"],10);n=isNaN(n)?0:n,r=isNaN(r)?0:r;var a=this.layout.size;n-=i?a.paddingLeft:a.paddingRight,r-=o?a.paddingTop:a.paddingBottom,this.position.x=n,this.position.y=r},a.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var y=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),r=parseInt(e,10),s=n===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isOriginLeft?a:-a,u=h.isOriginTop?u:-u,p.transform=y(a,u),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},a.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},a.prototype.moveTo=h?a.prototype._transitionTo:a.prototype.goTo,a.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},a.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},a.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var m=p&&o(p)+",opacity";a.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:m,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(c,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nonTransition"],a.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=g[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},a.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(c,this,!1),this.isTransitioning=!1},a.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionProperty:"",transitionDuration:""};return a.prototype.removeTransitionStyles=function(){this.css(v)},a.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},a.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},a.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getComputedStyle,s=r?function(t){return r(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],n):(t.Outlayer={},t.Outlayer.Item=n(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===f.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=d(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function s(i,s,f,d,l,y){function m(t,i){if("string"==typeof t&&(t=a.querySelector(t)),!t||!c(t))return u&&u.error("Bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var o=++g;this.element.outlayerGUID=o,v[o]=this,this._create(),this.options.isInitLayout&&this.layout()}var g=0,v={};return m.namespace="outlayer",m.Item=y,m.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(m.prototype,f.prototype),m.prototype.option=function(t){e(this.options,t)},m.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},m.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},m.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},m.prototype._filterFindItemElements=function(t){t=o(t);for(var e=this.options.itemSelector,i=[],n=0,r=t.length;r>n;n++){var s=t[n];if(c(s))if(e){l(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),u=0,p=a.length;p>u;u++)i.push(a[u])}else i.push(s)}return i},m.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},m.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},m.prototype._init=m.prototype.layout,m.prototype._resetLayout=function(){this.getSize()},m.prototype.getSize=function(){this.size=d(this.element)},m.prototype._getMeasurement=function(t,e){var i,o=this.options[t];o?("string"==typeof o?i=this.element.querySelector(o):c(o)&&(i=o),this[t]=i?d(i)[e]:o):this[t]=0},m.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},m.prototype._getItemsForLayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isIgnored||e.push(n)}return e},m.prototype._layoutItems=function(t,e){function i(){o.emitEvent("layoutComplete",[o,t])}var o=this;if(!t||!t.length)return i(),void 0;this._itemsOn(t,"layout",i);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getItemLayoutPosition(a);u.item=a,u.isInstant=e||a.isLayoutInstant,n.push(u)}this._processLayoutQueue(n)},m.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},m.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionItem(o.item,o.x,o.y,o.isInstant)}},m.prototype._positionItem=function(t,e,i,o){o?t.goTo(e,i):t.moveTo(e,i)},m.prototype._postLayout=function(){this.resizeContainer()},m.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},m.prototype._getContainerSize=h,m.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},m.prototype._itemsOn=function(t,e,i){function o(){return n++,n===r&&i.call(s),!0}for(var n=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var p=t[a];p.on(e,o)}},m.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},m.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},m.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},m.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n(o,this.stamps),this.unignore(o)}},m.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o(t)):void 0},m.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},m.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},m.prototype._manageStamp=h,m.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=d(t),n={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return n},m.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},m.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},m.prototype.unbindResize=function(){this.isResizeBound&&i.unbind(t,"resize",this),this.isResizeBound=!1},m.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},m.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},m.prototype.needsResizeLayout=function(){var t=d(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},m.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},m.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},m.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},m.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.reveal()}},m.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.hide()}},m.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},m.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i],r=this.getItem(n);r&&e.push(r)}return e}},m.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),n(s,this.items)}}},m.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindResize(),delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},m.data=function(t){var e=t&&t.outlayerGUID;return e&&v[e]},m.create=function(t,i){function o(){m.apply(this,arguments)}return Object.create?o.prototype=Object.create(m.prototype):e(o.prototype,m.prototype),o.prototype.constructor=o,o.defaults=e({},m.defaults),e(o.defaults,i),o.prototype.settings={},o.namespace=t,o.data=m.data,o.Item=function(){y.apply(this,arguments)},o.Item.prototype=new y,s(function(){for(var e=r(t),i=a.querySelectorAll(".js-"+e),n="data-"+e+"-options",s=0,h=i.length;h>s;s++){var f,c=i[s],d=c.getAttribute(n);try{f=d&&JSON.parse(d)}catch(l){u&&u.error("Error parsing "+n+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+l);continue}var y=new o(c,f);p&&p.data(c,t,y)}}),p&&p.bridget&&p.bridget(t,o),o},m.Item=y,m}var a=t.document,u=t.console,p=t.jQuery,h=function(){},f=Object.prototype.toString,c="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},d=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],s):t.Outlayer=s(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){function e(t){function e(){t.Item.apply(this,arguments)}return e.prototype=new t.Item,e.prototype._create=function(){this.id=this.layout.itemGUID++,t.Item.prototype._create.call(this),this.sortData={}},e.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}},e}"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window),function(t){function e(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!==this.isotope.size.innerHeight},i.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},i.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},i.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},i.prototype.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window),function(t){function e(t,e){var o=t.create("masonry");return o.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},o.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},o.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,o=e&&1>e?"round":"ceil",n=Math[o](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this._getColGroup(n),s=Math.min.apply(Math,r),a=i(r,s),u={x:this.columnWidth*a,y:s},p=s+t.size.outerHeight,h=this.cols+1-r.length,f=0;h>f;f++)this.colYs[a+f]=p;return u},o.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colYs.slice(o,o+t);e[o]=Math.max.apply(Math,n)}return e},o.prototype._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this.options.isOriginLeft?o.left:o.right,r=n+i.outerWidth,s=Math.floor(n/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this.options.isOriginTop?o.top:o.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(u,this.colYs[p])},o.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},o.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!==this.containerWidth},o}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++){var n=t[i];if(n===e)return i}return-1};"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):t.Masonry=e(t.Outlayer,t.getSize)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i){var o=t.create("masonry"),n=o.prototype._getElementOffset,r=o.prototype.layout,s=o.prototype._getMeasurement;e(o.prototype,i.prototype),o.prototype._getElementOffset=n,o.prototype.layout=r,o.prototype._getMeasurement=s;var a=o.prototype.measureColumns;o.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,a.call(this)};var u=o.prototype._manageStamp;return o.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,u.apply(this,arguments)},o}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],i):i(t.Isotope.LayoutMode,t.Masonry)}(window),function(t){function e(t){var e=t.create("fitRows");return e.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0},e.prototype._getItemLayoutPosition=function(t){t.getSize(),0!==this.x&&t.size.outerWidth+this.x>this.isotope.size.innerWidth&&(this.x=0,this.y=this.maxY);var e={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=t.size.outerWidth,e},e.prototype._getContainerSize=function(){return{height:this.maxY}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t){var e=t.create("vertical",{horizontalAlignment:0});return e.prototype._resetLayout=function(){this.y=0},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},e.prototype._getContainerSize=function(){return{height:this.y}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===h.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=f(e,t);-1!==i&&e.splice(i,1)}function r(t,i,r,u,h){function f(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortData[s],u=o.sortData[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var c=t.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});c.Item=u,c.LayoutMode=h,c.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),t.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var e in h.modes)this._initLayoutMode(e)},c.prototype.reloadItems=function(){this.itemGUID=0,t.prototype.reloadItems.call(this)},c.prototype._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),i=0,o=e.length;o>i;i++){var n=e[i];n.id=this.itemGUID++}return this._updateItemsSortData(e),e},c.prototype._initLayoutMode=function(t){var i=h.modes[t],o=this.options[t]||{};this.options[t]=i.options?e(i.options,o):o,this.modes[t]=new i(this)},c.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?(this.arrange(),void 0):(this._layout(),void 0)},c.prototype._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},c.prototype.arrange=function(t){this.option(t),this._getIsInstant(),this.filteredItems=this._filter(this.items),this._sort(),this._layout()},c.prototype._init=c.prototype.arrange,c.prototype._getIsInstant=function(){var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=t,t},c.prototype._filter=function(t){function e(){f.reveal(n),f.hide(r)}var i=this.options.filter;i=i||"*";for(var o=[],n=[],r=[],s=this._getFilterTest(i),a=0,u=t.length;u>a;a++){var p=t[a];if(!p.isIgnored){var h=s(p);h&&o.push(p),h&&p.isHidden?n.push(p):h||p.isHidden||r.push(p)}}var f=this;return this._isInstant?this._noTransition(e):e(),o},c.prototype._getFilterTest=function(t){return s&&this.options.isJQueryFiltering?function(e){return s(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return r(e.element,t)}},c.prototype.updateSortData=function(t){this._getSorters(),t=o(t);var e=this.getItems(t);e=e.length?e:this.items,this._updateItemsSortData(e) },c.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=d(i)}},c.prototype._updateItemsSortData=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];o.updateSortData()}};var d=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=c.sortDataParsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&p(i)}}return t}();c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},c.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=f(e,this.options.sortAscending);this.filteredItems.sort(i),t!==this.sortHistory[0]&&this.sortHistory.unshift(t)}},c.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},c.prototype._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},c.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},c.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},c.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},c.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},c.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},c.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps();var o=this._filterRevealAdded(e);this.layoutItems(i),this.filteredItems=o.concat(this.filteredItems)}},c.prototype._filterRevealAdded=function(t){var e=this._noTransition(function(){return this._filter(t)});return this.layoutItems(e,!0),this.reveal(e),t},c.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e);for(this._noTransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var l=c.prototype.remove;return c.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(l.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filteredItems)}},c.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},c}var s=t.jQuery,a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentElement,p=u.textContent?function(t){return t.textContent}:function(t){return t.innerText},h=Object.prototype.toString,f=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):t.Isotope=r(t.Outlayer,t.getSize,t.matchesSelector,t.Isotope.Item,t.Isotope.LayoutMode)}(window); (function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n.theiaStickySidebar:after {content: ""; display: table; clear: both;}')),o.each(function(){function o(){a.fixedScrollTop=0,a.sidebar.css({"min-height":"1px"}),a.stickySidebar.css({position:"static",width:"",transform:"none"})}function e(t){var o=t.height();return t.children().each(function(){o=Math.max(o,i(this).height())}),o}var a={};if(a.sidebar=i(this),a.options=t||{},a.container=i(a.options.containerSelector),0==a.container.length&&(a.container=a.sidebar.parent()),a.sidebar.parents().css("-webkit-transform","none"),a.sidebar.css({position:"relative",overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),a.stickySidebar=a.sidebar.find(".theiaStickySidebar"),0==a.stickySidebar.length){var r=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i;a.sidebar.find("script").filter(function(i,t){return 0===t.type.length||t.type.match(r)}).remove(),a.stickySidebar=i("
").addClass("theiaStickySidebar").append(a.sidebar.children()),a.sidebar.append(a.stickySidebar)}a.marginBottom=parseInt(a.sidebar.css("margin-bottom")),a.paddingTop=parseInt(a.sidebar.css("padding-top")),a.paddingBottom=parseInt(a.sidebar.css("padding-bottom"));var d=a.stickySidebar.offset().top,s=a.stickySidebar.outerHeight();a.stickySidebar.css("padding-top",1),a.stickySidebar.css("padding-bottom",1),d-=a.stickySidebar.offset().top,s=a.stickySidebar.outerHeight()-s-d,0==d?(a.stickySidebar.css("padding-top",0),a.stickySidebarPaddingTop=0):a.stickySidebarPaddingTop=1,0==s?(a.stickySidebar.css("padding-bottom",0),a.stickySidebarPaddingBottom=0):a.stickySidebarPaddingBottom=1,a.previousScrollTop=null,a.fixedScrollTop=0,o(),a.onScroll=function(a){if(a.stickySidebar.is(":visible")){if(i("body").width()a.container.width())return void o()}var d=i(document).scrollTop(),s="static";if(d>=a.sidebar.offset().top+(a.paddingTop-a.options.additionalMarginTop)){var c,p=a.paddingTop+t.additionalMarginTop,b=a.paddingBottom+a.marginBottom+t.additionalMarginBottom,l=a.sidebar.offset().top,f=a.sidebar.offset().top+e(a.container),h=0+t.additionalMarginTop,g=a.stickySidebar.outerHeight()+p+b0?Math.min(y,h):Math.max(y,c-a.stickySidebar.outerHeight()),y=Math.max(y,u),y=Math.min(y,S-a.stickySidebar.outerHeight());var k=a.container.height()==a.stickySidebar.outerHeight();s=(k||y!=h)&&(k||y!=c-a.stickySidebar.outerHeight())?d+y-a.sidebar.offset().top-a.paddingTop<=t.additionalMarginTop?"static":"absolute":"fixed"}if("fixed"==s){var v=i(document).scrollLeft();a.stickySidebar.css({position:"fixed",width:n(a.stickySidebar)+"px",transform:"translateY("+y+"px)",left:a.sidebar.offset().left+parseInt(a.sidebar.css("padding-left"))-v+"px",top:"0px"})}else if("absolute"==s){var x={};"absolute"!=a.stickySidebar.css("position")&&(x.position="absolute",x.transform="translateY("+(d+y-a.sidebar.offset().top-a.stickySidebarPaddingTop-a.stickySidebarPaddingBottom)+"px)",x.top="0px"),x.width=n(a.stickySidebar)+"px",x.left="",a.stickySidebar.css(x)}else"static"==s&&o();"static"!=s&&1==a.options.updateSidebarHeight&&a.sidebar.css({"min-height":a.stickySidebar.outerHeight()+a.stickySidebar.offset().top-a.sidebar.offset().top+a.paddingBottom}),a.previousScrollTop=d}},a.onScroll(a),i(document).scroll(function(i){return function(){i.onScroll(i)}}(a)),i(window).resize(function(i){return function(){i.stickySidebar.css({position:"static"}),i.onScroll(i)}}(a)),"undefined"!=typeof ResizeSensor&&new ResizeSensor(a.stickySidebar[0],function(i){return function(){i.onScroll(i)}}(a))})}function n(i){var t;try{t=i[0].getBoundingClientRect().width}catch(i){}return"undefined"==typeof t&&(t=i.width()),t}var r={containerSelector:"",additionalMarginTop:0,additionalMarginBottom:0,updateSidebarHeight:!0,minWidth:0,disableOnResponsiveLayouts:!0,sidebarBehavior:"modern"};t=i.extend(r,t),t.additionalMarginTop=parseInt(t.additionalMarginTop)||0,t.additionalMarginBottom=parseInt(t.additionalMarginBottom)||0,o(t,this)}}(jQuery); (function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if("object"==typeof a){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this); (function($){ $.fn.viewportChecker=function(useroptions){ var options={ classToAdd: 'visible', classToRemove:'invisible', classToAddForFullView:'full-visible', removeClassAfterAnimation: false, offset: 100, repeat: false, invertBottomOffset: true, callbackFunction: function(elem, action){}, scrollHorizontal: false, scrollBox: window }; $.extend(options, useroptions); var $elem=this, boxSize={height: $(options.scrollBox).height(), width: $(options.scrollBox).width()}, scrollElem=((navigator.userAgent.toLowerCase().indexOf('webkit')!=-1||navigator.userAgent.toLowerCase().indexOf('windows phone')!=-1) ? 'body':'html'); this.checkElements=function(){ var viewportStart, viewportEnd; if(!options.scrollHorizontal){ viewportStart=$(scrollElem).scrollTop(); viewportEnd=(viewportStart + boxSize.height); }else{ viewportStart=$(scrollElem).scrollLeft(); viewportEnd=(viewportStart + boxSize.width); } $elem.each(function(){ var $obj=$(this), objOptions={}, attrOptions={}; if($obj.data('vp-add-class')) attrOptions.classToAdd=$obj.data('vp-add-class'); if($obj.data('vp-remove-class')) attrOptions.classToRemove=$obj.data('vp-remove-class'); if($obj.data('vp-add-class-full-view')) attrOptions.classToAddForFullView=$obj.data('vp-add-class-full-view'); if($obj.data('vp-keep-add-class')) attrOptions.removeClassAfterAnimation=$obj.data('vp-remove-after-animation'); if($obj.data('vp-offset')) attrOptions.offset=$obj.data('vp-offset'); if($obj.data('vp-repeat')) attrOptions.repeat=$obj.data('vp-repeat'); if($obj.data('vp-scrollHorizontal')) attrOptions.scrollHorizontal=$obj.data('vp-scrollHorizontal'); if($obj.data('vp-invertBottomOffset')) attrOptions.scrollHorizontal=$obj.data('vp-invertBottomOffset'); $.extend(objOptions, options); $.extend(objOptions, attrOptions); if($obj.data('vp-animated')&&!objOptions.repeat){ return; } if(String(objOptions.offset).indexOf("%") > 0) objOptions.offset=(parseInt(objOptions.offset) / 100) * boxSize.height; var rawStart=(!objOptions.scrollHorizontal) ? $obj.offset().top:$obj.offset().left, rawEnd=(!objOptions.scrollHorizontal) ? rawStart + $obj.height():rawStart + $obj.width(); var elemStart=Math.round(rawStart) + objOptions.offset, elemEnd=(!objOptions.scrollHorizontal) ? elemStart + $obj.height():elemStart + $obj.width(); if(objOptions.invertBottomOffset) elemEnd -=(objOptions.offset * 2); if((elemStart < viewportEnd)&&(elemEnd > viewportStart)){ $obj.removeClass(objOptions.classToRemove); $obj.addClass(objOptions.classToAdd); objOptions.callbackFunction($obj, "add"); if(rawEnd <=viewportEnd&&rawStart >=viewportStart) $obj.addClass(objOptions.classToAddForFullView); else $obj.removeClass(objOptions.classToAddForFullView); $obj.data('vp-animated', true); if(objOptions.removeClassAfterAnimation){ $obj.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){ $obj.removeClass(objOptions.classToAdd); }); }}else if($obj.hasClass(objOptions.classToAdd)&&(objOptions.repeat)){ $obj.removeClass(objOptions.classToAdd + " " + objOptions.classToAddForFullView); objOptions.callbackFunction($obj, "remove"); $obj.data('vp-animated', false); }}); }; if('ontouchstart' in window||'onmsgesturechange' in window){ $(document).bind("touchmove MSPointerMove pointermove", this.checkElements); } $(options.scrollBox).bind("load scroll", this.checkElements); $(window).resize(function(e){ boxSize={height: $(options.scrollBox).height(), width: $(options.scrollBox).width()}; $elem.checkElements(); }); this.checkElements(); return this; };})(jQuery); (function (factory){ 'use strict'; if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof exports!=='undefined'){ module.exports=factory(require('jquery')); }else{ factory(jQuery); }})(function ($){ 'use strict'; function Hoverdir(element, options){ this.$el=$(element); this.options=$.extend(true, {}, this.defaults, options); this.isVisible=false; this.$hoverElem=this.$el.find(this.options.hoverElem); this.transitionProp='all ' + this.options.speed + 'ms ' + this.options.easing; this.support=this._supportsTransitions(); this._loadEvents(); } Hoverdir.prototype={ defaults: { speed: 300, easing: 'ease', hoverDelay: 0, inverse: false, hoverElem: 'div' }, constructor: Hoverdir, _supportsTransitions: function (){ if(typeof Modernizr!=='undefined'){ return Modernizr.csstransitions; }else{ var b=document.body||document.documentElement, s=b.style, p='transition'; if(typeof s[p]==='string'){ return true; } var v=['Moz', 'webkit', 'Webkit', 'Khtml', 'O', 'ms']; p=p.charAt(0).toUpperCase() + p.substr(1); for (var i=0; i < v.length; i++){ if(typeof s[v[i] + p]==='string'){ return true; }} return false; }}, _loadEvents: function (){ this.$el.on('mouseenter.hoverdir mouseleave.hoverdir', $.proxy(function (event){ this.direction=this._getDir({x: event.pageX, y: event.pageY}); if(event.type==='mouseenter'){ this._showHover(); }else{ this._hideHover(); }}, this)); }, _showHover: function (){ var styleCSS=this._getStyle(this.direction); if(this.support){ this.$hoverElem.css('transition', ''); } this.$hoverElem.hide().css(styleCSS.from); clearTimeout(this.tmhover); this.tmhover=setTimeout($.proxy(function (){ this.$hoverElem.show(0, $.proxy(function (){ if(this.support){ this.$hoverElem.css('transition', this.transitionProp); } this._applyAnimation(styleCSS.to); }, this)); }, this), this.options.hoverDelay); this.isVisible=true; }, _hideHover: function (){ var styleCSS=this._getStyle(this.direction); if(this.support){ this.$hoverElem.css('transition', this.transitionProp); } clearTimeout(this.tmhover); this._applyAnimation(styleCSS.from); this.isVisible=false; }, _getDir: function (coordinates){ var w=this.$el.width(), h=this.$el.height(), x=(coordinates.x - this.$el.offset().left - (w / 2)) * (w > h ? (h / w):1), y=(coordinates.y - this.$el.offset().top - (h / 2)) * (h > w ? (w / h):1), direction=Math.round((((Math.atan2(y, x) * (180 / Math.PI)) + 180) / 90) + 3) % 4; return direction; }, _getStyle: function (direction){ var fromStyle, toStyle, slideFromTop={'left': '0', 'top': '-100%'}, slideFromBottom={'left': '0', 'top': '100%'}, slideFromLeft={'left': '-100%', 'top': '0'}, slideFromRight={'left': '100%', 'top': '0'}, slideTop={'top': '0'}, slideLeft={'left': '0'}; switch (direction){ case 0: case 'top': fromStyle = !this.options.inverse ? slideFromTop:slideFromBottom; toStyle=slideTop; break; case 1: case 'right': fromStyle = !this.options.inverse ? slideFromRight:slideFromLeft; toStyle=slideLeft; break; case 2: case 'bottom': fromStyle = !this.options.inverse ? slideFromBottom:slideFromTop; toStyle=slideTop; break; case 3: case 'left': fromStyle = !this.options.inverse ? slideFromLeft:slideFromRight; toStyle=slideLeft; break; } return {from: fromStyle, to: toStyle};}, _applyAnimation: function (styleCSS){ $.fn.applyStyle=this.support ? $.fn.css:$.fn.animate; this.$hoverElem.stop().applyStyle(styleCSS, $.extend(true, [], {duration: this.options.speed})); }, show: function (direction){ this.$el.off('mouseenter.hoverdir mouseleave.hoverdir'); if(!this.isVisible){ this.direction=direction||'top'; this._showHover(); }}, hide: function (direction){ this.rebuild(); if(this.isVisible){ this.direction=direction||'bottom'; this._hideHover(); }}, setOptions: function (options){ this.options=$.extend(true, {}, this.defaults, this.options, options); }, destroy: function (){ this.$el.off('mouseenter.hoverdir mouseleave.hoverdir'); this.$el.data('hoverdir', null); }, rebuild: function (options){ if(typeof options==='object'){ this.setOptions(options); } this._loadEvents(); }}; $.fn.hoverdir=function (option, parameter){ return this.each(function (){ var data=$(this).data('hoverdir'); var options=typeof option==='object'&&option; if(!data){ data=new Hoverdir(this, options); $(this).data('hoverdir', data); } if(typeof option==='string'){ data[option](parameter); if(option==='destroy'){ $(this).data('hoverdir', false); }} }); }; $.fn.hoverdir.Constructor=Hoverdir; }); (function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf; a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual=> The jQuery method "'+b+'" you called does not exist';}var f={absolute:false,clone:false,includeMargin:false}; var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; ";e=e.clone().attr("style",m).appendTo("body"); };j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden");d+="visibility: hidden !important; display: block !important; "; if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this);var n=m.attr("style");g.push(n);m.attr("style",n?n+";"+d:d); });};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style");}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b](); j();return k;}});})(jQuery); (function (factory){ if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof exports==='object'){ module.exports=factory(require('jquery')); }else{ factory(jQuery); }}(function ($){ var pluses=/\+/g; function encode(s){ return config.raw ? s:encodeURIComponent(s); } function decode(s){ return config.raw ? s:decodeURIComponent(s); } function stringifyCookieValue(value){ return encode(config.json ? JSON.stringify(value):String(value)); } function parseCookieValue(s){ if(s.indexOf('"')===0){ s=s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { s=decodeURIComponent(s.replace(pluses, ' ')); return config.json ? JSON.parse(s):s; } catch(e){}} function read(s, converter){ var value=config.raw ? s:parseCookieValue(s); return $.isFunction(converter) ? converter(value):value; } var config=$.cookie=function (key, value, options){ if(arguments.length > 1&&!$.isFunction(value)){ options=$.extend({}, config.defaults, options); if(typeof options.expires==='number'){ var days=options.expires, t=options.expires=new Date(); t.setMilliseconds(t.getMilliseconds() + days * 864e+5); } return (document.cookie=[ encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString():'', options.path ? '; path=' + options.path:'', options.domain ? '; domain=' + options.domain:'', options.secure ? '; secure':'' ].join('')); } var result=key ? undefined:{}, cookies=document.cookie ? document.cookie.split('; '):[], i=0, l=cookies.length; for (; i < l; i++){ var parts=cookies[i].split('='), name=decode(parts.shift()), cookie=parts.join('='); if(key===name){ result=read(cookie, value); break; } if(!key&&(cookie=read(cookie))!==undefined){ result[name]=cookie; }} return result; }; config.defaults={}; $.removeCookie=function (key, options){ $.cookie(key, '', $.extend({}, options, { expires: -1 })); return !$.cookie(key); };})); !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__destroying=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;By&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.destroy()},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{var e=c.__geometry(),f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.lefti.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.topi.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c){var d=this,e=!0;if(d._trigger({type:"close",event:b,stop:function(){e=!1}}),e||d.__destroying){c&&d.__callbacks.close.push(c),d.__callbacks.open=[],d.__timeoutsClear();var f=function(){a.each(d.__callbacks.close,function(a,c){c.call(d,d,{event:b,origin:d._$origin[0]})}),d.__callbacks.close=[]};if("closed"!=d.__state){var g=!0,i=new Date,j=i.getTime(),k=j+d.__options.animationDuration[1];if("disappearing"==d.__state&&k>d.__closingTime&&(g=!1),g){d.__closingTime=k,"disappearing"!=d.__state&&d.__stateSet("disappearing");var l=function(){clearInterval(d.__tracker),d._trigger({type:"closing",event:b}),d._$tooltip.off("."+d.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+d.__namespace+"-triggerClose"),d.__$originParents.each(function(b,c){a(c).off("scroll."+d.__namespace+"-triggerClose")}),d.__$originParents=null,a(h.window.document.body).off("."+d.__namespace+"-triggerClose"),d._$origin.off("."+d.__namespace+"-triggerClose"),d._off("dismissable"),d.__stateSet("closed"),d._trigger({type:"after",event:b}),d.__options.functionAfter&&d.__options.functionAfter.call(d,d,{event:b,origin:d._$origin[0]}),f()};h.hasTransitions?(d._$tooltip.css({"-moz-animation-duration":d.__options.animationDuration[1]+"ms","-ms-animation-duration":d.__options.animationDuration[1]+"ms","-o-animation-duration":d.__options.animationDuration[1]+"ms","-webkit-animation-duration":d.__options.animationDuration[1]+"ms","animation-duration":d.__options.animationDuration[1]+"ms","transition-duration":d.__options.animationDuration[1]+"ms"}),d._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),d.__options.animationDuration[1]>0&&d._$tooltip.delay(d.__options.animationDuration[1]),d._$tooltip.queue(l)):d._$tooltip.stop().fadeOut(d.__options.animationDuration[1],l)}}else f()}return d},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;return b.__destroyed?b.__destroyError():b.__destroying||(b.__destroying=!0,b._close(null,function(){b._trigger("destroy"),b.__destroying=!1,b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("
").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)})),b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed||this.__destroying?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,destroying:this.__destroying,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('
').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom,width:a.width||a.right}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]));var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('
');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"), this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.valo&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a}); (function($){ function hasScrollBar(){ return $("body").height() > $(window).height(); } var JustifiedGallery=function ($gallery, settings){ this.settings=settings; this.checkSettings(); this.imgAnalyzerTimeout=null; this.entries=null; this.buildingRow={ entriesBuff:[], width:0, height:0, aspectRatio:0 }; this.lastFetchedEntry=null; this.lastAnalyzedIndex=-1; this.yield={ every:2, flushed:0 }; this.border=settings.border >=0 ? settings.border:settings.margins; this.maxRowHeight=this.retrieveMaxRowHeight(); this.suffixRanges=this.retrieveSuffixRanges(); this.offY=this.border; this.rows=0; this.spinner={ phase:0, timeSlot:150, $el:$('
'), intervalId:null }; this.checkWidthIntervalId=null; this.galleryWidth=$gallery.width(); this.$gallery=$gallery; }; JustifiedGallery.prototype.getSuffix=function (width, height){ var longestSide, i; longestSide=(width > height) ? width:height; for (i=0; i < this.suffixRanges.length; i++){ if(longestSide <=this.suffixRanges[i]){ return this.settings.sizeRangeSuffixes[this.suffixRanges[i]]; }} return this.settings.sizeRangeSuffixes[this.suffixRanges[i - 1]]; }; JustifiedGallery.prototype.removeSuffix=function (str, suffix){ return str.substring(0, str.length - suffix.length); }; JustifiedGallery.prototype.endsWith=function (str, suffix){ return str.indexOf(suffix, str.length - suffix.length)!==-1; }; JustifiedGallery.prototype.getUsedSuffix=function (str){ for (var si in this.settings.sizeRangeSuffixes){ if(this.settings.sizeRangeSuffixes.hasOwnProperty(si)){ if(this.settings.sizeRangeSuffixes[si].length===0) continue; if(this.endsWith(str, this.settings.sizeRangeSuffixes[si])) return this.settings.sizeRangeSuffixes[si]; }} return ''; }; JustifiedGallery.prototype.newSrc=function (imageSrc, imgWidth, imgHeight, image){ var newImageSrc; if(this.settings.thumbnailPath){ newImageSrc=this.settings.thumbnailPath(imageSrc, imgWidth, imgHeight, image); }else{ var matchRes=imageSrc.match(this.settings.extension); var ext=(matchRes!==null) ? matchRes[0]:''; newImageSrc=imageSrc.replace(this.settings.extension, ''); newImageSrc=this.removeSuffix(newImageSrc, this.getUsedSuffix(newImageSrc)); newImageSrc +=this.getSuffix(imgWidth, imgHeight) + ext; } return newImageSrc; }; JustifiedGallery.prototype.showImg=function ($entry, callback){ if(this.settings.cssAnimation){ $entry.addClass('entry-visible'); if(callback) callback(); }else{ $entry.stop().fadeTo(this.settings.imagesAnimationDuration, 1.0, callback); $entry.find('> img, > a > img').stop().fadeTo(this.settings.imagesAnimationDuration, 1.0, callback); }}; JustifiedGallery.prototype.extractImgSrcFromImage=function ($image){ var imageSrc=(typeof $image.data('safe-src')!=='undefined') ? $image.data('safe-src'):$image.attr('src'); $image.data('jg.originalSrc', imageSrc); return imageSrc; }; JustifiedGallery.prototype.imgFromEntry=function ($entry){ var $img=$entry.find('> img'); if($img.length===0) $img=$entry.find('> a > img'); return $img.length===0 ? null:$img; }; JustifiedGallery.prototype.captionFromEntry=function ($entry){ var $caption=$entry.find('> .caption'); return $caption.length===0 ? null:$caption; }; JustifiedGallery.prototype.displayEntry=function ($entry, x, y, imgWidth, imgHeight, rowHeight){ $entry.width(imgWidth); $entry.height(rowHeight); $entry.css('top', y); $entry.css('left', x); var $image=this.imgFromEntry($entry); if($image!==null){ $image.css('width', imgWidth); $image.css('height', imgHeight); $image.css('margin-left', - imgWidth / 2); $image.css('margin-top', - imgHeight / 2); var imageSrc=$image.attr('src'); var newImageSrc=this.newSrc(imageSrc, imgWidth, imgHeight, $image[0]); $image.one('error', function (){ $image.attr('src', $image.data('jg.originalSrc')); }); var loadNewImage=function (){ if(imageSrc!==newImageSrc){ $image.attr('src', newImageSrc); }}; if($entry.data('jg.loaded')==='skipped'){ this.onImageEvent(imageSrc, $.proxy(function(){ this.showImg($entry, loadNewImage); $entry.data('jg.loaded', true); }, this)); }else{ this.showImg($entry, loadNewImage); }}else{ this.showImg($entry); } this.displayEntryCaption($entry); }; JustifiedGallery.prototype.displayEntryCaption=function ($entry){ var $image=this.imgFromEntry($entry); if($image!==null&&this.settings.captions){ var $imgCaption=this.captionFromEntry($entry); if($imgCaption===null){ var caption=$image.attr('alt'); if(!this.isValidCaption(caption)) caption=$entry.attr('title'); if(this.isValidCaption(caption)){ $imgCaption=$('
' + caption + '
'); $entry.append($imgCaption); $entry.data('jg.createdCaption', true); }} if($imgCaption!==null){ if(!this.settings.cssAnimation) $imgCaption.stop().fadeTo(0, this.settings.captionSettings.nonVisibleOpacity); this.addCaptionEventsHandlers($entry); }}else{ this.removeCaptionEventsHandlers($entry); }}; JustifiedGallery.prototype.isValidCaption=function (caption){ return (typeof caption!=='undefined'&&caption.length > 0); }; JustifiedGallery.prototype.onEntryMouseEnterForCaption=function (eventObject){ var $caption=this.captionFromEntry($(eventObject.currentTarget)); if(this.settings.cssAnimation){ $caption.addClass('caption-visible').removeClass('caption-hidden'); }else{ $caption.stop().fadeTo(this.settings.captionSettings.animationDuration, this.settings.captionSettings.visibleOpacity); }}; JustifiedGallery.prototype.onEntryMouseLeaveForCaption=function (eventObject){ var $caption=this.captionFromEntry($(eventObject.currentTarget)); if(this.settings.cssAnimation){ $caption.removeClass('caption-visible').removeClass('caption-hidden'); }else{ $caption.stop().fadeTo(this.settings.captionSettings.animationDuration, this.settings.captionSettings.nonVisibleOpacity); }}; JustifiedGallery.prototype.addCaptionEventsHandlers=function ($entry){ var captionMouseEvents=$entry.data('jg.captionMouseEvents'); if(typeof captionMouseEvents==='undefined'){ captionMouseEvents={ mouseenter: $.proxy(this.onEntryMouseEnterForCaption, this), mouseleave: $.proxy(this.onEntryMouseLeaveForCaption, this) }; $entry.on('mouseenter', undefined, undefined, captionMouseEvents.mouseenter); $entry.on('mouseleave', undefined, undefined, captionMouseEvents.mouseleave); $entry.data('jg.captionMouseEvents', captionMouseEvents); }}; JustifiedGallery.prototype.removeCaptionEventsHandlers=function ($entry){ var captionMouseEvents=$entry.data('jg.captionMouseEvents'); if(typeof captionMouseEvents!=='undefined'){ $entry.off('mouseenter', undefined, captionMouseEvents.mouseenter); $entry.off('mouseleave', undefined, captionMouseEvents.mouseleave); $entry.removeData('jg.captionMouseEvents'); }}; JustifiedGallery.prototype.prepareBuildingRow=function (isLastRow){ var i, $entry, imgAspectRatio, newImgW, newImgH, justify=true; var minHeight=0; var availableWidth=this.galleryWidth - 2 * this.border - ( (this.buildingRow.entriesBuff.length - 1) * this.settings.margins); var rowHeight=availableWidth / this.buildingRow.aspectRatio; var defaultRowHeight=this.settings.rowHeight; var justifiable=this.buildingRow.width / availableWidth > this.settings.justifyThreshold; if(isLastRow&&this.settings.lastRow==='hide'&&!justifiable){ for (i=0; i < this.buildingRow.entriesBuff.length; i++){ $entry=this.buildingRow.entriesBuff[i]; if(this.settings.cssAnimation) $entry.removeClass('entry-visible'); else { $entry.stop().fadeTo(0, 0.1); $entry.find('> img, > a > img').fadeTo(0, 0); }} return -1; } if(isLastRow&&!justifiable&&this.settings.lastRow!=='justify'&&this.settings.lastRow!=='hide'){ justify=false; if(this.rows > 0){ defaultRowHeight=(this.offY - this.border - this.settings.margins * this.rows) / this.rows; justify=defaultRowHeight * this.buildingRow.aspectRatio / availableWidth > this.settings.justifyThreshold; }} for (i=0; i < this.buildingRow.entriesBuff.length; i++){ $entry=this.buildingRow.entriesBuff[i]; imgAspectRatio=$entry.data('jg.width') / $entry.data('jg.height'); if(justify){ newImgW=(i===this.buildingRow.entriesBuff.length - 1) ? availableWidth:rowHeight * imgAspectRatio; newImgH=rowHeight; }else{ newImgW=defaultRowHeight * imgAspectRatio; newImgH=defaultRowHeight; } availableWidth -=Math.round(newImgW); $entry.data('jg.jwidth', Math.round(newImgW)); $entry.data('jg.jheight', Math.ceil(newImgH)); if(i===0||minHeight > newImgH) minHeight=newImgH; } this.buildingRow.height=minHeight; return justify; }; JustifiedGallery.prototype.clearBuildingRow=function (){ this.buildingRow.entriesBuff=[]; this.buildingRow.aspectRatio=0; this.buildingRow.width=0; }; JustifiedGallery.prototype.flushRow=function (isLastRow){ var settings=this.settings; var $entry, buildingRowRes, offX=this.border, i; buildingRowRes=this.prepareBuildingRow(isLastRow); if(isLastRow&&settings.lastRow==='hide'&&buildingRowRes===-1){ this.clearBuildingRow(); return; } if(this.maxRowHeight){ if(this.maxRowHeight.isPercentage&&this.maxRowHeight.value * settings.rowHeight < this.buildingRow.height){ this.buildingRow.height=this.maxRowHeight.value * settings.rowHeight; }else if(this.maxRowHeight.value >=settings.rowHeight&&this.maxRowHeight.value < this.buildingRow.height){ this.buildingRow.height=this.maxRowHeight.value; }} if(settings.lastRow==='center'||settings.lastRow==='right'){ var availableWidth=this.galleryWidth - 2 * this.border - (this.buildingRow.entriesBuff.length - 1) * settings.margins; for (i=0; i < this.buildingRow.entriesBuff.length; i++){ $entry=this.buildingRow.entriesBuff[i]; availableWidth -=$entry.data('jg.jwidth'); } if(settings.lastRow==='center') offX +=availableWidth / 2; else if(settings.lastRow==='right') offX +=availableWidth; } for (i=0; i < this.buildingRow.entriesBuff.length; i++){ $entry=this.buildingRow.entriesBuff[i]; this.displayEntry($entry, offX, this.offY, $entry.data('jg.jwidth'), $entry.data('jg.jheight'), this.buildingRow.height); offX +=$entry.data('jg.jwidth') + settings.margins; } this.galleryHeightToSet=this.offY + this.buildingRow.height + this.border; this.$gallery.height(this.galleryHeightToSet + this.getSpinnerHeight()); if(!isLastRow||(this.buildingRow.height <=settings.rowHeight&&buildingRowRes)){ this.offY +=this.buildingRow.height + settings.margins; this.rows +=1; this.clearBuildingRow(); this.$gallery.trigger('jg.rowflush'); }}; var scrollBarOn=false; JustifiedGallery.prototype.checkWidth=function (){ this.checkWidthIntervalId=setInterval($.proxy(function (){ var galleryWidth=parseFloat(this.$gallery.width()); if(hasScrollBar()===scrollBarOn){ if(Math.abs(galleryWidth - this.galleryWidth) > this.settings.refreshSensitivity){ this.galleryWidth=galleryWidth; this.rewind(); this.startImgAnalyzer(true); }}else{ scrollBarOn=hasScrollBar(); this.galleryWidth=galleryWidth; }}, this), this.settings.refreshTime); }; JustifiedGallery.prototype.isSpinnerActive=function (){ return this.spinner.intervalId!==null; }; JustifiedGallery.prototype.getSpinnerHeight=function (){ return this.spinner.$el.innerHeight(); }; JustifiedGallery.prototype.stopLoadingSpinnerAnimation=function (){ clearInterval(this.spinner.intervalId); this.spinner.intervalId=null; this.$gallery.height(this.$gallery.height() - this.getSpinnerHeight()); this.spinner.$el.detach(); }; JustifiedGallery.prototype.startLoadingSpinnerAnimation=function (){ var spinnerContext=this.spinner; var $spinnerPoints=spinnerContext.$el.find('span'); clearInterval(spinnerContext.intervalId); this.$gallery.append(spinnerContext.$el); this.$gallery.height(this.offY + this.buildingRow.height + this.getSpinnerHeight()); spinnerContext.intervalId=setInterval(function (){ if(spinnerContext.phase < $spinnerPoints.length){ $spinnerPoints.eq(spinnerContext.phase).fadeTo(spinnerContext.timeSlot, 1); }else{ $spinnerPoints.eq(spinnerContext.phase - $spinnerPoints.length).fadeTo(spinnerContext.timeSlot, 0); } spinnerContext.phase=(spinnerContext.phase + 1) % ($spinnerPoints.length * 2); }, spinnerContext.timeSlot); }; JustifiedGallery.prototype.rewind=function (){ this.lastFetchedEntry=null; this.lastAnalyzedIndex=-1; this.offY=this.border; this.rows=0; this.clearBuildingRow(); }; JustifiedGallery.prototype.updateEntries=function (norewind){ var newEntries; if(norewind&&this.lastFetchedEntry!=null){ newEntries=$(this.lastFetchedEntry).nextAll(this.settings.selector).toArray(); }else{ this.entries=[]; newEntries=this.$gallery.children(this.settings.selector).toArray(); } if(newEntries.length > 0){ if($.isFunction(this.settings.sort)){ newEntries=this.sortArray(newEntries); }else if(this.settings.randomize){ newEntries=this.shuffleArray(newEntries); } this.lastFetchedEntry=newEntries[newEntries.length - 1]; if(this.settings.filter){ newEntries=this.filterArray(newEntries); }else{ this.resetFilters(newEntries); }} this.entries=this.entries.concat(newEntries); return true; }; JustifiedGallery.prototype.insertToGallery=function (entries){ var that=this; $.each(entries, function (){ $(this).appendTo(that.$gallery); }); }; JustifiedGallery.prototype.shuffleArray=function (a){ var i, j, temp; for (i=a.length - 1; i > 0; i--){ j=Math.floor(Math.random() * (i + 1)); temp=a[i]; a[i]=a[j]; a[j]=temp; } this.insertToGallery(a); return a; }; JustifiedGallery.prototype.sortArray=function (a){ a.sort(this.settings.sort); this.insertToGallery(a); return a; }; JustifiedGallery.prototype.resetFilters=function (a){ for (var i=0; i < a.length; i++) $(a[i]).removeClass('jg-filtered'); }; JustifiedGallery.prototype.filterArray=function (a){ var settings=this.settings; if($.type(settings.filter)==='string'){ return a.filter(function (el){ var $el=$(el); if($el.is(settings.filter)){ $el.removeClass('jg-filtered'); return true; }else{ $el.addClass('jg-filtered').removeClass('jg-visible'); return false; }}); }else if($.isFunction(settings.filter)){ var filteredArr=a.filter(settings.filter); for (var i=0; i < a.length; i++){ if(filteredArr.indexOf(a[i])==-1){ $(a[i]).addClass('jg-filtered').removeClass('jg-visible'); }else{ $(a[i]).removeClass('jg-filtered'); }} return filteredArr; }}; JustifiedGallery.prototype.destroy=function (){ clearInterval(this.checkWidthIntervalId); $.each(this.entries, $.proxy(function(_, entry){ var $entry=$(entry); $entry.css('width', ''); $entry.css('height', ''); $entry.css('top', ''); $entry.css('left', ''); $entry.data('jg.loaded', undefined); $entry.removeClass('jg-entry'); var $img=this.imgFromEntry($entry); $img.css('width', ''); $img.css('height', ''); $img.css('margin-left', ''); $img.css('margin-top', ''); $img.attr('src', $img.data('jg.originalSrc')); $img.data('jg.originalSrc', undefined); this.removeCaptionEventsHandlers($entry); var $caption=this.captionFromEntry($entry); if($entry.data('jg.createdCaption')){ $entry.data('jg.createdCaption', undefined); if($caption!==null) $caption.remove(); }else{ if($caption!==null) $caption.fadeTo(0, 1); }}, this)); this.$gallery.css('height', ''); this.$gallery.removeClass('justified-gallery'); this.$gallery.data('jg.controller', undefined); }; JustifiedGallery.prototype.analyzeImages=function (isForResize){ for (var i=this.lastAnalyzedIndex + 1; i < this.entries.length; i++){ var $entry=$(this.entries[i]); if($entry.data('jg.loaded')===true||$entry.data('jg.loaded')==='skipped'){ var availableWidth=this.galleryWidth - 2 * this.border - ( (this.buildingRow.entriesBuff.length - 1) * this.settings.margins); var imgAspectRatio=$entry.data('jg.width') / $entry.data('jg.height'); if(availableWidth / (this.buildingRow.aspectRatio + imgAspectRatio) < this.settings.rowHeight){ this.flushRow(false); if(++this.yield.flushed >=this.yield.every){ this.startImgAnalyzer(isForResize); return; }} this.buildingRow.entriesBuff.push($entry); this.buildingRow.aspectRatio +=imgAspectRatio; this.buildingRow.width +=imgAspectRatio * this.settings.rowHeight; this.lastAnalyzedIndex=i; }else if($entry.data('jg.loaded')!=='error'){ return; }} if(this.buildingRow.entriesBuff.length > 0) this.flushRow(true); if(this.isSpinnerActive()){ this.stopLoadingSpinnerAnimation(); } this.stopImgAnalyzerStarter(); this.$gallery.trigger(isForResize ? 'jg.resize':'jg.complete'); this.$gallery.height(this.galleryHeightToSet); }; JustifiedGallery.prototype.stopImgAnalyzerStarter=function (){ this.yield.flushed=0; if(this.imgAnalyzerTimeout!==null) clearTimeout(this.imgAnalyzerTimeout); }; JustifiedGallery.prototype.startImgAnalyzer=function (isForResize){ var that=this; this.stopImgAnalyzerStarter(); this.imgAnalyzerTimeout=setTimeout(function (){ that.analyzeImages(isForResize); }, 0.001); }; JustifiedGallery.prototype.onImageEvent=function (imageSrc, onLoad, onError){ if(!onLoad&&!onError) return; var memImage=new Image(); var $memImage=$(memImage); if(onLoad){ $memImage.one('load', function (){ $memImage.off('load error'); onLoad(memImage); }); } if(onError){ $memImage.one('error', function(){ $memImage.off('load error'); onError(memImage); }); } memImage.src=imageSrc; }; JustifiedGallery.prototype.init=function (){ var imagesToLoad=false, skippedImages=false, that=this; $.each(this.entries, function (index, entry){ var $entry=$(entry); var $image=that.imgFromEntry($entry); $entry.addClass('jg-entry'); if($entry.data('jg.loaded')!==true&&$entry.data('jg.loaded')!=='skipped'){ if(that.settings.rel!==null) $entry.attr('rel', that.settings.rel); if(that.settings.target!==null) $entry.attr('target', that.settings.target); if($image!==null){ var imageSrc=that.extractImgSrcFromImage($image); $image.attr('src', imageSrc); if(that.settings.waitThumbnailsLoad===false){ var width=parseFloat($image.attr('width')); var height=parseFloat($image.attr('height')); if(!isNaN(width)&&!isNaN(height)){ $entry.data('jg.width', width); $entry.data('jg.height', height); $entry.data('jg.loaded', 'skipped'); skippedImages=true; that.startImgAnalyzer(false); return true; }} $entry.data('jg.loaded', false); imagesToLoad=true; if(!that.isSpinnerActive()) that.startLoadingSpinnerAnimation(); that.onImageEvent(imageSrc, function (loadImg){ $entry.data('jg.width', loadImg.width); $entry.data('jg.height', loadImg.height); $entry.data('jg.loaded', true); that.startImgAnalyzer(false); }, function (){ $entry.data('jg.loaded', 'error'); that.startImgAnalyzer(false); }); }else{ $entry.data('jg.loaded', true); $entry.data('jg.width', $entry.width() | parseFloat($entry.css('width')) | 1); $entry.data('jg.height', $entry.height() | parseFloat($entry.css('height')) | 1); }} }); if(!imagesToLoad&&!skippedImages) this.startImgAnalyzer(false); this.checkWidth(); }; JustifiedGallery.prototype.checkOrConvertNumber=function (settingContainer, settingName){ if($.type(settingContainer[settingName])==='string'){ settingContainer[settingName]=parseFloat(settingContainer[settingName]); } if($.type(settingContainer[settingName])==='number'){ if(isNaN(settingContainer[settingName])) throw 'invalid number for ' + settingName; }else{ throw settingName + ' must be a number'; }}; JustifiedGallery.prototype.checkSizeRangesSuffixes=function (){ if($.type(this.settings.sizeRangeSuffixes)!=='object'){ throw 'sizeRangeSuffixes must be defined and must be an object'; } var suffixRanges=[]; for (var rangeIdx in this.settings.sizeRangeSuffixes){ if(this.settings.sizeRangeSuffixes.hasOwnProperty(rangeIdx)) suffixRanges.push(rangeIdx); } var newSizeRngSuffixes={0: ''}; for (var i=0; i < suffixRanges.length; i++){ if($.type(suffixRanges[i])==='string'){ try { var numIdx=parseInt(suffixRanges[i].replace(/^[a-z]+/, ''), 10); newSizeRngSuffixes[numIdx]=this.settings.sizeRangeSuffixes[suffixRanges[i]]; } catch (e){ throw 'sizeRangeSuffixes keys must contains correct numbers (' + e + ')'; }}else{ newSizeRngSuffixes[suffixRanges[i]]=this.settings.sizeRangeSuffixes[suffixRanges[i]]; }} this.settings.sizeRangeSuffixes=newSizeRngSuffixes; }; JustifiedGallery.prototype.retrieveMaxRowHeight=function (){ var newMaxRowHeight={ }; if($.type(this.settings.maxRowHeight)==='string'){ if(this.settings.maxRowHeight.match(/^[0-9]+%$/)){ newMaxRowHeight.value=parseFloat(this.settings.maxRowHeight.match(/^([0-9]+)%$/)[1]) / 100; newMaxRowHeight.isPercentage=false; }else{ newMaxRowHeight.value=parseFloat(this.settings.maxRowHeight); newMaxRowHeight.isPercentage=true; }}else if($.type(this.settings.maxRowHeight)==='number'){ newMaxRowHeight.value=this.settings.maxRowHeight; newMaxRowHeight.isPercentage=false; }else if(this.settings.maxRowHeight===false || this.settings.maxRowHeight===null || typeof this.settings.maxRowHeight=='undefined'){ return null; }else{ throw 'maxRowHeight must be a number or a percentage'; } if(isNaN(newMaxRowHeight.value)) throw 'invalid number for maxRowHeight'; if(newMaxRowHeight.isPercentage){ if(newMaxRowHeight.value < 100) newMaxRowHeight.value=100; } return newMaxRowHeight; }; JustifiedGallery.prototype.checkSettings=function (){ this.checkSizeRangesSuffixes(); this.checkOrConvertNumber(this.settings, 'rowHeight'); this.checkOrConvertNumber(this.settings, 'margins'); this.checkOrConvertNumber(this.settings, 'border'); var lastRowModes=[ 'justify', 'nojustify', 'left', 'center', 'right', 'hide' ]; if(lastRowModes.indexOf(this.settings.lastRow)===-1){ throw 'lastRow must be one of: ' + lastRowModes.join(', '); } this.checkOrConvertNumber(this.settings, 'justifyThreshold'); if(this.settings.justifyThreshold < 0||this.settings.justifyThreshold > 1){ throw 'justifyThreshold must be in the interval [0,1]'; } if($.type(this.settings.cssAnimation)!=='boolean'){ throw 'cssAnimation must be a boolean'; } if($.type(this.settings.captions)!=='boolean') throw 'captions must be a boolean'; this.checkOrConvertNumber(this.settings.captionSettings, 'animationDuration'); this.checkOrConvertNumber(this.settings.captionSettings, 'visibleOpacity'); if(this.settings.captionSettings.visibleOpacity < 0 || this.settings.captionSettings.visibleOpacity > 1){ throw 'captionSettings.visibleOpacity must be in the interval [0, 1]'; } this.checkOrConvertNumber(this.settings.captionSettings, 'nonVisibleOpacity'); if(this.settings.captionSettings.nonVisibleOpacity < 0 || this.settings.captionSettings.nonVisibleOpacity > 1){ throw 'captionSettings.nonVisibleOpacity must be in the interval [0, 1]'; } this.checkOrConvertNumber(this.settings, 'imagesAnimationDuration'); this.checkOrConvertNumber(this.settings, 'refreshTime'); this.checkOrConvertNumber(this.settings, 'refreshSensitivity'); if($.type(this.settings.randomize)!=='boolean') throw 'randomize must be a boolean'; if($.type(this.settings.selector)!=='string') throw 'selector must be a string'; if(this.settings.sort!==false&&!$.isFunction(this.settings.sort)){ throw 'sort must be false or a comparison function'; } if(this.settings.filter!==false&&!$.isFunction(this.settings.filter) && $.type(this.settings.filter)!=='string'){ throw 'filter must be false, a string or a filter function'; }}; JustifiedGallery.prototype.retrieveSuffixRanges=function (){ var suffixRanges=[]; for (var rangeIdx in this.settings.sizeRangeSuffixes){ if(this.settings.sizeRangeSuffixes.hasOwnProperty(rangeIdx)) suffixRanges.push(parseInt(rangeIdx, 10)); } suffixRanges.sort(function (a, b){ return a > b ? 1:a < b ? -1:0; }); return suffixRanges; }; JustifiedGallery.prototype.updateSettings=function (newSettings){ this.settings=$.extend({}, this.settings, newSettings); this.checkSettings(); this.border=this.settings.border >=0 ? this.settings.border:this.settings.margins; this.maxRowHeight=this.retrieveMaxRowHeight(); this.suffixRanges=this.retrieveSuffixRanges(); }; $.fn.justifiedGallery=function (arg){ return this.each(function (index, gallery){ var $gallery=$(gallery); $gallery.addClass('justified-gallery'); var controller=$gallery.data('jg.controller'); if(typeof controller==='undefined'){ if(typeof arg!=='undefined'&&arg!==null&&$.type(arg)!=='object'){ if(arg==='destroy') return; throw 'The argument must be an object'; } controller=new JustifiedGallery($gallery, $.extend({}, $.fn.justifiedGallery.defaults, arg)); $gallery.data('jg.controller', controller); }else if(arg==='norewind'){ }else if(arg==='destroy'){ controller.destroy(); return; }else{ controller.updateSettings(arg); controller.rewind(); } if(!controller.updateEntries(arg==='norewind')) return; controller.init(); }); }; $.fn.justifiedGallery.defaults={ sizeRangeSuffixes: { }, thumbnailPath: undefined, rowHeight: 120, maxRowHeight: false, margins: 1, border: -1, lastRow: 'nojustify', justifyThreshold: 0.90, waitThumbnailsLoad: true, captions: true, cssAnimation: true, imagesAnimationDuration: 500, captionSettings: { animationDuration: 500, visibleOpacity: 0.7, nonVisibleOpacity: 0.0 }, rel: null, target: null, extension: /\.[^.\\/]+$/, refreshTime: 200, refreshSensitivity: 0, randomize: false, sort: false, filter: false, selector: 'a, div:not(.spinner)' };}(jQuery)); !function t(e,n,r){function o(i,s){if(!n[i]){if(!e[i]){var a="function"==typeof require&&require;if(!s&&a)return a(i,!0);if(l)return l(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[i]={exports:{}};e[i][0].call(u.exports,function(t){var n=e[i][1][t];return o(n?n:t)},u,u.exports,t,e,n,r)}return n[i].exports}for(var l="function"==typeof require&&require,i=0;i=0&&n.splice(r,1),t.className=n.join(" ")}n.add=function(t,e){t.classList?t.classList.add(e):r(t,e)},n.remove=function(t,e){t.classList?t.classList.remove(e):o(t,e)},n.list=function(t){return t.classList?Array.prototype.slice.apply(t.classList):t.className.split(" ")}},{}],3:[function(t,e,n){"use strict";function r(t,e){return window.getComputedStyle(t)[e]}function o(t,e,n){return"number"==typeof n&&(n=n.toString()+"px"),t.style[e]=n,t}function l(t,e){for(var n in e){var r=e[n];"number"==typeof r&&(r=r.toString()+"px"),t.style[n]=r}return t}var i={};i.e=function(t,e){var n=document.createElement(t);return n.className=e,n},i.appendTo=function(t,e){return e.appendChild(t),t},i.css=function(t,e,n){return"object"==typeof e?l(t,e):"undefined"==typeof n?r(t,e):o(t,e,n)},i.matches=function(t,e){return"undefined"!=typeof t.matches?t.matches(e):"undefined"!=typeof t.matchesSelector?t.matchesSelector(e):"undefined"!=typeof t.webkitMatchesSelector?t.webkitMatchesSelector(e):"undefined"!=typeof t.mozMatchesSelector?t.mozMatchesSelector(e):"undefined"!=typeof t.msMatchesSelector?t.msMatchesSelector(e):void 0},i.remove=function(t){"undefined"!=typeof t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)},i.queryChildren=function(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return i.matches(t,e)})},e.exports=i},{}],4:[function(t,e,n){"use strict";var r=function(t){this.element=t,this.events={}};r.prototype.bind=function(t,e){"undefined"==typeof this.events[t]&&(this.events[t]=[]),this.events[t].push(e),this.element.addEventListener(t,e,!1)},r.prototype.unbind=function(t,e){var n="undefined"!=typeof e;this.events[t]=this.events[t].filter(function(r){return!(!n||r===e)||(this.element.removeEventListener(t,r,!1),!1)},this)},r.prototype.unbindAll=function(){for(var t in this.events)this.unbind(t)};var o=function(){this.eventElements=[]};o.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return"undefined"==typeof e&&(e=new r(t),this.eventElements.push(e)),e},o.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},o.prototype.unbind=function(t,e,n){this.eventElement(t).unbind(e,n)},o.prototype.unbindAll=function(){for(var t=0;te.scrollbarYTop?1:-1;i(t,"top",t.scrollTop+s*e.containerHeight),l(t),r.stopPropagation()}),e.event.bind(e.scrollbarX,"click",r),e.event.bind(e.scrollbarXRail,"click",function(r){var o=r.pageX-window.pageXOffset-n(e.scrollbarXRail).left,s=o>e.scrollbarXLeft?1:-1;i(t,"left",t.scrollLeft+s*e.containerWidth),l(t),r.stopPropagation()})}var o=t("../instances"),l=t("../update-geometry"),i=t("../update-scroll");e.exports=function(t){var e=o.get(t);r(t,e)}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(t,e,n){"use strict";function r(t,e){function n(n){var o=r+n*e.railXRatio,i=Math.max(0,e.scrollbarXRail.getBoundingClientRect().left)+e.railXRatio*(e.railXWidth-e.scrollbarXWidth);o<0?e.scrollbarXLeft=0:o>i?e.scrollbarXLeft=i:e.scrollbarXLeft=o;var s=l.toInt(e.scrollbarXLeft*(e.contentWidth-e.containerWidth)/(e.containerWidth-e.railXRatio*e.scrollbarXWidth))-e.negativeScrollAdjustment;c(t,"left",s)}var r=null,o=null,s=function(e){n(e.pageX-o),a(t),e.stopPropagation(),e.preventDefault()},u=function(){l.stopScrolling(t,"x"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarX,"mousedown",function(n){o=n.pageX,r=l.toInt(i.css(e.scrollbarX,"left"))*e.railXRatio,l.startScrolling(t,"x"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}function o(t,e){function n(n){var o=r+n*e.railYRatio,i=Math.max(0,e.scrollbarYRail.getBoundingClientRect().top)+e.railYRatio*(e.railYHeight-e.scrollbarYHeight);o<0?e.scrollbarYTop=0:o>i?e.scrollbarYTop=i:e.scrollbarYTop=o;var s=l.toInt(e.scrollbarYTop*(e.contentHeight-e.containerHeight)/(e.containerHeight-e.railYRatio*e.scrollbarYHeight));c(t,"top",s)}var r=null,o=null,s=function(e){n(e.pageY-o),a(t),e.stopPropagation(),e.preventDefault()},u=function(){l.stopScrolling(t,"y"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarY,"mousedown",function(n){o=n.pageY,r=l.toInt(i.css(e.scrollbarY,"top"))*e.railYRatio,l.startScrolling(t,"y"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}var l=t("../../lib/helper"),i=t("../../lib/dom"),s=t("../instances"),a=t("../update-geometry"),c=t("../update-scroll");e.exports=function(t){var e=s.get(t);r(t,e),o(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(t,e,n){"use strict";function r(t,e){function n(n,r){var o=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&r<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(0===r){if(!e.scrollbarXActive)return!1;if(0===l&&n<0||l>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}var r=!1;e.event.bind(t,"mouseenter",function(){r=!0}),e.event.bind(t,"mouseleave",function(){r=!1});var i=!1;e.event.bind(e.ownerDocument,"keydown",function(c){if(!(c.isDefaultPrevented&&c.isDefaultPrevented()||c.defaultPrevented)){var u=l.matches(e.scrollbarX,":focus")||l.matches(e.scrollbarY,":focus");if(r||u){var d=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(d){if("IFRAME"===d.tagName)d=d.contentDocument.activeElement;else for(;d.shadowRoot;)d=d.shadowRoot.activeElement;if(o.isEditable(d))return}var p=0,f=0;switch(c.which){case 37:p=c.metaKey?-e.contentWidth:c.altKey?-e.containerWidth:-30;break;case 38:f=c.metaKey?e.contentHeight:c.altKey?e.containerHeight:30;break;case 39:p=c.metaKey?e.contentWidth:c.altKey?e.containerWidth:30;break;case 40:f=c.metaKey?-e.contentHeight:c.altKey?-e.containerHeight:-30;break;case 33:f=90;break;case 32:f=c.shiftKey?90:-90;break;case 34:f=-90;break;case 35:f=c.ctrlKey?-e.contentHeight:-e.containerHeight;break;case 36:f=c.ctrlKey?t.scrollTop:e.containerHeight;break;default:return}a(t,"top",t.scrollTop-f),a(t,"left",t.scrollLeft+p),s(t),i=n(p,f),i&&c.preventDefault()}}})}var o=t("../../lib/helper"),l=t("../../lib/dom"),i=t("../instances"),s=t("../update-geometry"),a=t("../update-scroll");e.exports=function(t){var e=i.get(t);r(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(t,e,n){"use strict";function r(t,e){function n(n,r){var o=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&r<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(0===r){if(!e.scrollbarXActive)return!1;if(0===l&&n<0||l>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}function r(t){var e=t.deltaX,n=-1*t.deltaY;return"undefined"!=typeof e&&"undefined"!=typeof n||(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!==e&&n!==n&&(e=0,n=t.wheelDelta),t.shiftKey?[-n,-e]:[e,n]}function o(e,n){var r=t.querySelector("textarea:hover, select[multiple]:hover, .ps-child:hover");if(r){if(!window.getComputedStyle(r).overflow.match(/(scroll|auto)/))return!1;var o=r.scrollHeight-r.clientHeight;if(o>0&&!(0===r.scrollTop&&n>0||r.scrollTop===o&&n<0))return!0;var l=r.scrollLeft-r.clientWidth;if(l>0&&!(0===r.scrollLeft&&e<0||r.scrollLeft===l&&e>0))return!0}return!1}function s(s){var c=r(s),u=c[0],d=c[1];o(u,d)||(a=!1,e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(d?i(t,"top",t.scrollTop-d*e.settings.wheelSpeed):i(t,"top",t.scrollTop+u*e.settings.wheelSpeed),a=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(u?i(t,"left",t.scrollLeft+u*e.settings.wheelSpeed):i(t,"left",t.scrollLeft-d*e.settings.wheelSpeed),a=!0):(i(t,"top",t.scrollTop-d*e.settings.wheelSpeed),i(t,"left",t.scrollLeft+u*e.settings.wheelSpeed)),l(t),a=a||n(u,d),a&&(s.stopPropagation(),s.preventDefault()))}var a=!1;"undefined"!=typeof window.onwheel?e.event.bind(t,"wheel",s):"undefined"!=typeof window.onmousewheel&&e.event.bind(t,"mousewheel",s)}var o=t("../instances"),l=t("../update-geometry"),i=t("../update-scroll");e.exports=function(t){var e=o.get(t);r(t,e)}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(t,e,n){"use strict";function r(t,e){e.event.bind(t,"scroll",function(){l(t)})}var o=t("../instances"),l=t("../update-geometry");e.exports=function(t){var e=o.get(t);r(t,e)}},{"../instances":18,"../update-geometry":19}],15:[function(t,e,n){"use strict";function r(t,e){function n(){var t=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"";return 0===t.toString().length?null:t.getRangeAt(0).commonAncestorContainer}function r(){c||(c=setInterval(function(){return l.get(t)?(s(t,"top",t.scrollTop+u.top),s(t,"left",t.scrollLeft+u.left),void i(t)):void clearInterval(c)},50))}function a(){c&&(clearInterval(c),c=null),o.stopScrolling(t)}var c=null,u={top:0,left:0},d=!1;e.event.bind(e.ownerDocument,"selectionchange",function(){t.contains(n())?d=!0:(d=!1,a())}),e.event.bind(window,"mouseup",function(){d&&(d=!1,a())}),e.event.bind(window,"keyup",function(){d&&(d=!1,a())}),e.event.bind(window,"mousemove",function(e){if(d){var n={x:e.pageX,y:e.pageY},l={left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight};n.xl.right-3?(u.left=5,o.startScrolling(t,"x")):u.left=0,n.yl.bottom-3?(n.y-l.bottom+3<5?u.top=5:u.top=20,o.startScrolling(t,"y")):u.top=0,0===u.top&&0===u.left?a():r()}})}var o=t("../../lib/helper"),l=t("../instances"),i=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=l.get(t);r(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(t,e,n){"use strict";function r(t,e,n,r){function o(n,r){var o=t.scrollTop,l=t.scrollLeft,i=Math.abs(n),s=Math.abs(r);if(s>i){if(r<0&&o===e.contentHeight-e.containerHeight||r>0&&0===o)return!e.settings.swipePropagation}else if(i>s&&(n<0&&l===e.contentWidth-e.containerWidth||n>0&&0===l))return!e.settings.swipePropagation;return!0}function a(e,n){s(t,"top",t.scrollTop-n),s(t,"left",t.scrollLeft-e),i(t)}function c(){w=!0}function u(){w=!1}function d(t){return t.targetTouches?t.targetTouches[0]:t}function p(t){return!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE)}function f(t){if(p(t)){Y=!0;var e=d(t);g.pageX=e.pageX,g.pageY=e.pageY,v=(new Date).getTime(),null!==y&&clearInterval(y),t.stopPropagation()}}function h(t){if(!Y&&e.settings.swipePropagation&&f(t),!w&&Y&&p(t)){var n=d(t),r={pageX:n.pageX,pageY:n.pageY},l=r.pageX-g.pageX,i=r.pageY-g.pageY;a(l,i),g=r;var s=(new Date).getTime(),c=s-v;c>0&&(m.x=l/c,m.y=i/c,v=s),o(l,i)&&(t.stopPropagation(),t.preventDefault())}}function b(){!w&&Y&&(Y=!1,clearInterval(y),y=setInterval(function(){return l.get(t)&&(m.x||m.y)?Math.abs(m.x)<.01&&Math.abs(m.y)<.01?void clearInterval(y):(a(30*m.x,30*m.y),m.x*=.8,void(m.y*=.8)):void clearInterval(y)},10))}var g={},v=0,m={},y=null,w=!1,Y=!1;n&&(e.event.bind(window,"touchstart",c),e.event.bind(window,"touchend",u),e.event.bind(t,"touchstart",f),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",b)),r&&(window.PointerEvent?(e.event.bind(window,"pointerdown",c),e.event.bind(window,"pointerup",u),e.event.bind(t,"pointerdown",f),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",b)):window.MSPointerEvent&&(e.event.bind(window,"MSPointerDown",c),e.event.bind(window,"MSPointerUp",u),e.event.bind(t,"MSPointerDown",f),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",b)))}var o=t("../../lib/helper"),l=t("../instances"),i=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){if(o.env.supportsTouch||o.env.supportsIePointer){var e=l.get(t);r(t,e,o.env.supportsTouch,o.env.supportsIePointer)}}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(t,e,n){"use strict";var r=t("../lib/helper"),o=t("../lib/class"),l=t("./instances"),i=t("./update-geometry"),s={"click-rail":t("./handler/click-rail"),"drag-scrollbar":t("./handler/drag-scrollbar"),keyboard:t("./handler/keyboard"),wheel:t("./handler/mouse-wheel"),touch:t("./handler/touch"),selection:t("./handler/selection")},a=t("./handler/native-scroll");e.exports=function(t,e){e="object"==typeof e?e:{},o.add(t,"ps-container");var n=l.add(t);n.settings=r.extend(n.settings,e),o.add(t,"ps-theme-"+n.settings.theme),n.settings.handlers.forEach(function(e){s[e](t)}),a(t),i(t)}},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(t,e,n){"use strict";function r(t){function e(){a.add(t,"ps-focus")}function n(){a.remove(t,"ps-focus")}var r=this;r.settings=s.clone(c),r.containerWidth=null,r.containerHeight=null,r.contentWidth=null,r.contentHeight=null,r.isRtl="rtl"===u.css(t,"direction"),r.isNegativeScroll=function(){var e=t.scrollLeft,n=null;return t.scrollLeft=-1,n=t.scrollLeft<0,t.scrollLeft=e,n}(),r.negativeScrollAdjustment=r.isNegativeScroll?t.scrollWidth-t.clientWidth:0,r.event=new d,r.ownerDocument=t.ownerDocument||document,r.scrollbarXRail=u.appendTo(u.e("div","ps-scrollbar-x-rail"),t),r.scrollbarX=u.appendTo(u.e("div","ps-scrollbar-x"),r.scrollbarXRail),r.scrollbarX.setAttribute("tabindex",0),r.event.bind(r.scrollbarX,"focus",e),r.event.bind(r.scrollbarX,"blur",n),r.scrollbarXActive=null,r.scrollbarXWidth=null,r.scrollbarXLeft=null,r.scrollbarXBottom=s.toInt(u.css(r.scrollbarXRail,"bottom")),r.isScrollbarXUsingBottom=r.scrollbarXBottom===r.scrollbarXBottom,r.scrollbarXTop=r.isScrollbarXUsingBottom?null:s.toInt(u.css(r.scrollbarXRail,"top")),r.railBorderXWidth=s.toInt(u.css(r.scrollbarXRail,"borderLeftWidth"))+s.toInt(u.css(r.scrollbarXRail,"borderRightWidth")),u.css(r.scrollbarXRail,"display","block"),r.railXMarginWidth=s.toInt(u.css(r.scrollbarXRail,"marginLeft"))+s.toInt(u.css(r.scrollbarXRail,"marginRight")),u.css(r.scrollbarXRail,"display",""),r.railXWidth=null,r.railXRatio=null,r.scrollbarYRail=u.appendTo(u.e("div","ps-scrollbar-y-rail"),t),r.scrollbarY=u.appendTo(u.e("div","ps-scrollbar-y"),r.scrollbarYRail),r.scrollbarY.setAttribute("tabindex",0),r.event.bind(r.scrollbarY,"focus",e),r.event.bind(r.scrollbarY,"blur",n),r.scrollbarYActive=null,r.scrollbarYHeight=null,r.scrollbarYTop=null,r.scrollbarYRight=s.toInt(u.css(r.scrollbarYRail,"right")),r.isScrollbarYUsingRight=r.scrollbarYRight===r.scrollbarYRight,r.scrollbarYLeft=r.isScrollbarYUsingRight?null:s.toInt(u.css(r.scrollbarYRail,"left")),r.scrollbarYOuterWidth=r.isRtl?s.outerWidth(r.scrollbarY):null,r.railBorderYWidth=s.toInt(u.css(r.scrollbarYRail,"borderTopWidth"))+s.toInt(u.css(r.scrollbarYRail,"borderBottomWidth")),u.css(r.scrollbarYRail,"display","block"),r.railYMarginHeight=s.toInt(u.css(r.scrollbarYRail,"marginTop"))+s.toInt(u.css(r.scrollbarYRail,"marginBottom")),u.css(r.scrollbarYRail,"display",""),r.railYHeight=null,r.railYRatio=null}function o(t){return t.getAttribute("data-ps-id")}function l(t,e){t.setAttribute("data-ps-id",e)}function i(t){t.removeAttribute("data-ps-id")}var s=t("../lib/helper"),a=t("../lib/class"),c=t("./default-setting"),u=t("../lib/dom"),d=t("../lib/event-manager"),p=t("../lib/guid"),f={};n.add=function(t){var e=p();return l(t,e),f[e]=new r(t),f[e]},n.remove=function(t){delete f[o(t)],i(t)},n.get=function(t){return f[o(t)]}},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(t,e,n){"use strict";function r(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function o(t,e){var n={width:e.railXWidth};e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft,e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-t.scrollTop:n.top=e.scrollbarXTop+t.scrollTop,s.css(e.scrollbarXRail,n);var r={top:t.scrollTop,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?r.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:r.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?r.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:r.left=e.scrollbarYLeft+t.scrollLeft,s.css(e.scrollbarYRail,r),s.css(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),s.css(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}var l=t("../lib/helper"),i=t("../lib/class"),s=t("../lib/dom"),a=t("./instances"),c=t("./update-scroll");e.exports=function(t){var e=a.get(t);e.containerWidth=t.clientWidth,e.containerHeight=t.clientHeight,e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight;var n;t.contains(e.scrollbarXRail)||(n=s.queryChildren(t,".ps-scrollbar-x-rail"),n.length>0&&n.forEach(function(t){s.remove(t)}),s.appendTo(e.scrollbarXRail,t)),t.contains(e.scrollbarYRail)||(n=s.queryChildren(t,".ps-scrollbar-y-rail"),n.length>0&&n.forEach(function(t){s.remove(t)}),s.appendTo(e.scrollbarYRail,t)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),o(t,e),e.scrollbarXActive?i.add(t,"ps-active-x"):(i.remove(t,"ps-active-x"),e.scrollbarXWidth=0,e.scrollbarXLeft=0,c(t,"left",0)),e.scrollbarYActive?i.add(t,"ps-active-y"):(i.remove(t,"ps-active-y"),e.scrollbarYHeight=0,e.scrollbarYTop=0,c(t,"top",0))}},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(t,e,n){"use strict";var r,o,l=t("./instances"),i=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!0),e};e.exports=function(t,e,n){if("undefined"==typeof t)throw"You must provide an element to the update-scroll function";if("undefined"==typeof e)throw"You must provide an axis to the update-scroll function";if("undefined"==typeof n)throw"You must provide a value to the update-scroll function";"top"===e&&n<=0&&(t.scrollTop=n=0,t.dispatchEvent(i("ps-y-reach-start"))),"left"===e&&n<=0&&(t.scrollLeft=n=0,t.dispatchEvent(i("ps-x-reach-start")));var s=l.get(t);"top"===e&&n>=s.contentHeight-s.containerHeight&&(n=s.contentHeight-s.containerHeight,n-t.scrollTop<=1?n=t.scrollTop:t.scrollTop=n,t.dispatchEvent(i("ps-y-reach-end"))),"left"===e&&n>=s.contentWidth-s.containerWidth&&(n=s.contentWidth-s.containerWidth,n-t.scrollLeft<=1?n=t.scrollLeft:t.scrollLeft=n,t.dispatchEvent(i("ps-x-reach-end"))),r||(r=t.scrollTop),o||(o=t.scrollLeft),"top"===e&&nr&&t.dispatchEvent(i("ps-scroll-down")),"left"===e&&no&&t.dispatchEvent(i("ps-scroll-right")),"top"===e&&(t.scrollTop=r=n,t.dispatchEvent(i("ps-scroll-y"))),"left"===e&&(t.scrollLeft=o=n,t.dispatchEvent(i("ps-scroll-x")))}},{"./instances":18}],21:[function(t,e,n){"use strict";var r=t("../lib/helper"),o=t("../lib/dom"),l=t("./instances"),i=t("./update-geometry"),s=t("./update-scroll");e.exports=function(t){var e=l.get(t);e&&(e.negativeScrollAdjustment=e.isNegativeScroll?t.scrollWidth-t.clientWidth:0,o.css(e.scrollbarXRail,"display","block"),o.css(e.scrollbarYRail,"display","block"),e.railXMarginWidth=r.toInt(o.css(e.scrollbarXRail,"marginLeft"))+r.toInt(o.css(e.scrollbarXRail,"marginRight")),e.railYMarginHeight=r.toInt(o.css(e.scrollbarYRail,"marginTop"))+r.toInt(o.css(e.scrollbarYRail,"marginBottom")),o.css(e.scrollbarXRail,"display","none"),o.css(e.scrollbarYRail,"display","none"),i(t),s(t,"top",t.scrollTop),s(t,"left",t.scrollLeft),o.css(e.scrollbarXRail,"display",""),o.css(e.scrollbarYRail,"display",""))}},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]); !function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function c(){}function d(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}return a}function e(c){function e(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||f("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=c("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var g=document.body||document.documentElement;g.appendChild(e);var h=j(e);l=200===b(h.width),g.removeChild(e)}}}function h(a){if(e(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var h=f.isBorderBox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return h}var f="undefined"==typeof console?c:function(a){console.error(a)},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getSize=e(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){function b(a,b){return a[g](b)}function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}var i=a.getComputedStyle,j=i?function(a){return i(a,null)}:function(a){return a.currentStyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionDuration","transitionProperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=j(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexOf("%")?parseFloat(e)/100*g.width:parseInt(e,10),i=-1!=f.indexOf("%")?parseFloat(f)/100*g.height:parseInt(f,10);h=isNaN(h)?0:h,i=isNaN(i)?0:i,h-=c?g.paddingLeft:g.paddingRight,i-=d?g.paddingTop:g.paddingBottom,this.position.x=h,this.position.y=i},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];c[e]=this.getXValue(g),c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getYValue(k),c[j]="",this.css(c),this.emitEvent("layout",[this])},g.prototype.getXValue=function(a){var b=this.layout.options;return b.percentPosition&&!b.isHorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getYValue=function(a){var b=this.layout.options;return b.percentPosition&&b.isHorizontal?a/this.layout.size.height*100+"%":a+"px"},g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={};j.transform=this.getTranslate(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.getTranslate=function(a,b){var c=this.layout.options;return a=c.isOriginLeft?a:-a,b=c.isOriginTop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=m?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r="opacity,"+h(q.transform||"transform");g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!k||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.dispatchEvent(a+"Complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.Event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)}return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}); jQuery(document).ready(function ($){ "use strict"; $(".post-content-gallery.justify").each(function(){ $(this).justifiedGallery({ selector: 'div, div:not(.spinner)', rowHeight: $(this).attr('data-justify'), maxRowHeight: parseInt($(this).attr('data-justify')) * 0.7, margins: 10 }); }); $('.post-content-gallery.slider .post-gallery-list').slick({ fade: true, swipe: true, dots: false, arrows: true, cssEase: 'cubic-bezier(0.445, 0.05, 0.55, 0.95)', prevArrow: '', nextArrow: '' }); $('.post-content-gallery.slider .post-gallery-list').on('afterChange', function (event, slick, currentSlide, nextSlide){ var i=(currentSlide ? currentSlide:0) + 1; $(this).parents('.post-content-gallery.slider').find('.post-gallery-pagination').text(i + '/' + slick.slideCount); }); $('.primary-mobile .sh-nav-mobile').html($('.primary-desktop #header-navigation .sh-nav').html()); $('.primary-mobile .sh-nav-mobile > li.menu-item-has-mega-menu').each(function(){ if($(this).find('.mega-menu-dynamic-elements').length){ var menu_items=''; if($(this).find('.nav-tabs-header-categories a').length){ menu_items='
'; }else{ if($(this).find('.header-dynamic-categories').attr('data-cat')&&$(this).find('.header-dynamic-categories').attr('data-cat-link')){ menu_items +=''; }} $(this).append(menu_items); $(this).find('.mega-menu-dynamic-elements').remove(); }}); $('.post-item.post-header-item').each(function(){ var background_image=''; if($(this).attr('data-i')){ background_image='
' + '
' + '
' + '
' + '
' + '
' + '' + '
' + '' + '' + '' + '
' + '
' + '
'; } $(this).html('
' + background_image + '
' + '' + '

'+ $(this).attr('data-t') +'

' + '
' + '' + '
' + '
'); $(this).removeAttr('data-i').removeAttr('data-t').removeAttr('data-l').removeAttr('data-d'); }); $('.nav-tabs-header-categories a').on("click", function(){ window.location=$(this).attr('href'); }); $('.post-overlay').html('
'); $(document).off('click.bs.tab.data-api', '[data-hover="tab"]'); $(document).on('mouseenter.bs.tab.data-api', '[data-hover="tab"]', function (){ $(this).tab('show'); }); if($('.tab-pagination').length > 0){ $('.tab-pagination .tab-pagination-back').on('click', function(){ var tab_current_item=$(this).parents('.tab-pane').find('.nav-tabs > .active'); tab_current_item.prev('li').find('a').trigger('click'); var tab_current_item_new=$(this).parents('.tab-pane').find('.nav-tabs > .active'); if(tab_current_item_new.prev('li').length > 0){ $(this).removeClass('disabled'); }else{ $(this).addClass('disabled'); } if(tab_current_item_new.next('li').length > 0){ $(this).parent().find('.tab-pagination-next').removeClass('disabled'); }else{ $(this).parent().find('.tab-pagination-next').addClass('disabled'); }}); $('.tab-pagination .tab-pagination-next').on('click', function(){ var tab_current_item=$(this).parents('.tab-pane').find('.nav-tabs > .active'); tab_current_item.next('li').find('a').trigger('click'); var tab_current_item_new=$(this).parents('.tab-pane').find('.nav-tabs > .active'); if(tab_current_item_new.next('li').length > 0){ $(this).removeClass('disabled'); }else{ $(this).addClass('disabled'); } if(tab_current_item_new.prev('li').length > 0){ $(this).parent().find('.tab-pagination-back').removeClass('disabled'); }else{ $(this).parent().find('.tab-pagination-back').addClass('disabled'); }}); $('.tab-pagination .tab-pagination-back').trigger('click'); } setTimeout(function(){ if($(document).width() < 1025){ $('.primary-desktop .sh-nav ul.sub-menu').css('display', 'none'); }}, 50); function gillion_header_dropdown(){ if($(document).width() > 1000){ $('.sh-header-mobile-dropdown').hide(); $('.sh-nav-dropdown').removeClass('open'); } if($(document).width() < 1025){ $('body').removeClass('page-layout-right-fixed'); $('.primary-desktop ul.sub-menu').css('display', 'none'); }} gillion_header_dropdown(); function gillion_navigation_position(){ var new_position, menu_status, menu_width, menu_offset, window_width; window_width=$(document).width(); $('ul.sh-nav ul').mouseover(function(){ menu_status=$(this).find('.sub-menu').length; if(menu_status > 0){ menu_width=$(this).find('.sub-menu').width(); menu_offset=$(this).find('.sub-menu').parent().offset().left + menu_width; if((menu_offset + menu_width) > window_width){ new_position=menu_width + 0; $(this).find('.sub-menu').css({ left: -new_position-0, top: '0', }); }else{ $(this).find('.sub-menu').css({ left: new_position+0, top: '0', }); }} }); } gillion_navigation_position(); function gillion_megamenu(){ $('.sh-nav .mega-menu-row').each(function(){ $(this).children().css('height',''); var self=$(this); var count=parseInt($(this).children().length); if(count > 0&&count <=4){ $(this).addClass('mega-menu-row-'+count); var maxHeight=$(self).actual('height'); $(this).find('>:nth-child(-n+'+count+')').each(function(){ $(this).height(maxHeight); }); }else{ $(this).addClass('mega-menu-row-5'); var count_now=0; while(count >=count_now){ count_now +=4; var maxHeight=-1; $(this).find('>:nth-child(n+'+(count_now-3)+'):nth-child(-n+'+count_now+')').each(function(){ maxHeight=maxHeight > $(this).actual('height') ? maxHeight:$(this).actual('height'); }); $(this).find('>:nth-child(n+'+(count_now-3)+'):nth-child(-n+'+count_now+')').each(function(){ $(this).height(maxHeight); }); }} }); } gillion_megamenu(); $(window).resize(function(){ clearTimeout(window.resizedFinished); window.resizedFinished=setTimeout(function(){ gillion_header_dropdown(); gillion_navigation_position(); gillion_megamenu(); }, 500); }); var primary_desktop=$('.sh-header-middle').actual('outerHeight') + $('.sh-header').actual('outerHeight') + $('.sh-header-top').actual('outerHeight'); $('header.primary-desktop').css('height', primary_desktop); $('header.primary-mobile').css('height', $('header.primary-mobile').actual('height')); var primary_desktop='' $(window).on('load resize', function(){ if($(document).width() > 1000){ $('header.primary-desktop').css('height',''); primary_desktop=$('.sh-header-middle').actual('outerHeight') + $('.sh-header').actual('outerHeight') + $('.sh-header-top').actual('outerHeight'); $('header.primary-desktop').css('height', primary_desktop); $('.header-dynamic-categories-side, .header-dynamic-categories-content').css('height', ''); $('.header-dynamic-categories').each(function(){ $(this).find('.header-dynamic-categories-side, .header-dynamic-categories-content').css('height', $(this).actual('outerHeight')); }); }}); $(window).load(function(){ $(".sh-nav-search").on('click', function(e){ $(".sh-header-search-side").css('width', 'auto').css('height', 'auto').css('opacity', '1'); $(".sh-header-search-side-input").focus(); return false; }); $(".sh-header-search-side").on('click', function(e){ var search_class=$(e.target).attr('class'); if(search_class!='sh-header-search-side-input'&&search_class!='sh-header-search-side-icon'&&search_class!='ti-search'){ $(".sh-header-search-side").css('opacity', '0'); setTimeout(function(){ $(".sh-header-search-side").css('width', '0px').css('height', '0px'); }, 300); } return false; }); $('.sh-header-search-side-icon').on('click', function(){ $('.sh-header-search-form').submit(); }); }); $(document).keyup(function(e){ if(e.keyCode==27){ $("#header-search").fadeOut("fast"); }}); $('.sh-header-mobile-dropdown ul li:has(">ul") a').on('click', function(){ $(this).parent().toggleClass('open'); $(this).parent().find('> ul').stop(true, true).slideToggle(300, 'easeOutQuint'); if($(this).parent().hasClass('open')){ $(this).parent().find('ul ul').stop(true, true).slideUp(0, 'easeOutQuint'); } if($(this).parent().hasClass('menu-item-has-children')){ return false; }}); $('html').click(function(){ if($('.sh-header-mobile-dropdown').is(':visible')){ $('.sh-nav-dropdown .c-hamburger').trigger('click').toggleClass('is-active'); }}); $('.sh-header-mobile-dropdown').click(function(event){ event.stopPropagation(); }); var $masonry=$('.blog-style-masonry:not(.sh-recent-posts-list-carousel), .post-content-gallery.masonry').isotope({ itemSelector: '.post-item, .post-content-gallery-item', columnWidth: 0, gutter: 0, }).isotope('reloadItems'); $masonry.imagesLoaded(function(){ $masonry.isotope('layout').css('opacity', 1); }); $(window).load(function (){ setTimeout(function(){ $masonry.isotope('layout'); }, 0); }); if($(document).width() <=1025&&$(document).width() > 700){ var $masonry=$('.sidebar-container').isotope({ itemSelector: '.widget-item', columnWidth: 0, gutter: 0, }).isotope('reloadItems'); $masonry.imagesLoaded(function(){ $masonry.isotope('layout').css('opacity', 1); }); $(window).load(function (){ setTimeout(function(){ $masonry.isotope('layout'); }, 0); }); } function gillion_sticky(){ if($(document).width() > 1025){ if(header_height < 0){ header_height=$('.sh-header').actual('height'); } if(header_offset_total < 0){ if($('#wpadminbar').length){ var header_admin=$('#wpadminbar').actual('height'); }else{ var header_admin=0; } if($('.sh-header').length){ var header_offset=$('.sh-header').offset().top - header_admin; }else{ var header_offset=0; } header_offset_total=header_offset; } if($(document).scrollTop() > header_offset_total){ if(!$('body').hasClass('compose-mode')){ $('.sh-header').addClass('sh-sticky-header-active').css('top', $('#wpadminbar').actual('height')); }else{ $('.sh-header').addClass('sh-sticky-header-active'); }}else{ if(primary_desktop > 0){ $('.sh-header-height').css('height', primary_desktop); $('.sh-header:not(.sh-header-2):not(.sh-header-3):not(.sh-header-4)').css('height', primary_desktop); setTimeout(function(){ $('.sh-header-height').css('height', ''); $('.sh-header:not(.sh-header-2):not(.sh-header-3):not(.sh-header-4)').css('height', ''); }, 300); } $('.sh-header').removeClass('sh-sticky-header-active').css('top', 0); }} } if($('.sh-sticky-header').length){ if($('#wpadminbar').length){ var header_admin=$('#wpadminbar').height(); }else{ var header_admin=0; } if($('.sh-header').length){ var header_offset=$('.sh-header').offset().top - header_admin; }else{ var header_offset=0; } var header_height=$('.sh-header').height(); var header_offset_total=header_offset; var header_offset_sticky=0; gillion_sticky(); $(window).scroll(gillion_sticky); } if($('.sh-copyrights-image').height() > 0){ $('.sh-copyrights-text, .sh-copyrights-social').css('line-height', $('.sh-copyrights-image').height()+'px'); } $('.sh-sidebar-search').blur(function(){ $(this).parent().parent().parent().removeClass("sh-sidebar-search-active"); }) .focus(function(){ $(this).parent().parent().parent().addClass("sh-sidebar-search-active") }); if($('.sh-back-to-top').length){ var scrollTrigger=100, backToTop=function (){ var scrollTop=$(window).scrollTop(); if(scrollTop > scrollTrigger){ $('.sh-back-to-top').addClass('active'); }else{ $('.sh-back-to-top').removeClass('active'); }}; backToTop(); $(window).on('scroll', function (){ backToTop(); }); $('.sh-back-to-top').on('click', function (e){ e.preventDefault(); $(this).blur(); $('html,body').animate({ scrollTop: 0 }, 500); }); } $('iframe').each(function(){ var iframe_src=$(this).attr('src'); if(iframe_src){ if(iframe_src.indexOf("youtube.com")!==-1){ return this.src + '?title=0&byline=0&portrait=0'; }} }); if($(window).width() >=768){ $('.sh-titlebar-parallax').jarallax({ speed: 0.5 }); $('body.single .blog-slider-item').jarallax({ speed: 0.5 }); }else{ $('.sh-titlebar-parallax').addClass('sh-titlebar-parallax-disabled'); } $('.widget_categories li').each(function(){ var cat_count=$(this).clone().children().remove().end().text().trim().slice(1, -1); if(cat_count){ $(this).find('> a').append('' + cat_count + ''); }}); $('.widget_categories').each(function(){ if($(this).find('li').length > 7){ $(this).append(''); }}); $('body').on('click', '.widget_categories_button', function(){ $(this).parent().parent().find('li').css('display', 'block'); $(this).remove(); return false; }); $('.sh-social-share-button').on('click', function(){ $(this).next().toggleClass('sh-social-share-networks-active'); }); function gillion_navigation(){ $("ul.sh-nav").superfish({ delay: gillion.header_animation_dropdown_delay, hoverClass: 'sh-hover', animation: { opacity: "show", height:'show' }, animationOut: { opacity: "hide", height:'hide' }, easing: gillion.header_animation_dropdown, speed: 500, speedOut: 0, cssArrows: false, pathLevels: 2, onBeforeShow: function(){ if($(this).hasClass('mega-menu-dynamic-elements')){ var self_mega=$(this); $(this).find('.sh-ratio-content[data-lazy-background]').each(function(){ $(this).css('background-image', 'url("' + $(this).attr('data-lazy-background') + '")'); }); $(this).find('.sh-ratio-content[data-lazy-background]').imagesLoaded({ background: true }, function(){ self_mega.find('.header-dynamic-categories-loader').hide(); }); }else if($(this).hasClass('sh-read-later-list')){ $(this).find('.sh-read-later-thumbnail[data-lazy-background]').each(function(){ $(this).css('background-image', 'url("' + $(this).attr('data-lazy-background') + '")'); }); }} }); } gillion_navigation(); if(!$('header.primary-desktop .sh-nav-social').find('a').length){ $('header.primary-desktop .sh-nav-social').remove(); } /*$.fn.isVisible=function(){ var rect=this[0].getBoundingClientRect(); return ( (rect.height > 0||rect.width > 0) && rect.bottom >=0 && rect.right >=0 && (rect.top - 1000) <=(window.innerHeight||document.documentElement.clientHeight) && rect.left <=(window.innerWidth||document.documentElement.clientWidth) ); };*/ /*var instagram_loaded=0; $(window).on('load scroll', function(){ if(instagram_loaded==0) : clearTimeout(window.scrollFinished2); window.scrollFinished2=setTimeout(function(){ if($('.sh-footer-instagram').isVisible()){ console.log('ir redzams'); }}, 50); endif; });*/ $('.sh-header-mobile .sh-nav-dropdown').click(function(){ $('.sh-header-mobile-dropdown').stop(true, true).slideToggle(gillion.header_animation_dropdown_speed, gillion.header_animation_dropdown ); return false; }); if(gillion.notice!==false){ if(gillion.notice=='enable2'){ $('.sh-page-notice').show(); $(".sh-page-notice-button").on('click', function(){ $('.sh-page-notice').hide(); return false; }); }else{ if('set'!==$.cookie('sh-notice')){ $('.sh-page-notice').show(); $(".sh-page-notice-button").on('click', function(){ $.cookie('sh-notice', 'set', { expires: 356, path: '/' }); $('.sh-page-notice').hide(); return false; }); }} } $("a[rel^='sh-lightbox'], a[rel^='lightbox'],a[data-rel^=lightcase]").lightcase({ maxWidth: 1200, maxHeight: 1200, overlayOpacity: gillion.lightbox_opacity, transition: gillion.lightbox_transition, labels: { 'sequenceInfo.of': ' / ', }, }); $('.sh-login-popup-trigger').lightcase({ type: 'inline', maxWidth: 440, inline: { height: 460 }}); $('.sh-login-popup-content-login input[type="text"], .sh-login-popup-content-login input[type="password"]').attr('required', 'required'); if(gillion.page_loader==1){ $(".sh-page-loader").fadeOut(500); $("body").css('overflow', 'visible'); $(window).bind('beforeunload', function(e){ $('.sh-page-loader').fadeIn(); }); } if(gillion.rtl_support==1){ } function gillion_footer_parallax(){ if($(document).width() > 850){ $("#wrapper > .content-container").css('margin-bottom', $('.sh-footer').height()); }else{ $("#wrapper > .content-container").css('margin-bottom', ''); }} function gillion_footer_parallax_visible(){ if($(document).width() > 850){ if(( $(document).height() - ($(window).scrollTop() + $(window).height())) < $('.sh-footer').height()){ $('.sh-footer').css('opacity', '1'); }else{ $('.sh-footer').css('opacity', '0'); }} } if(gillion.footer_parallax==1){ $("body").addClass('sh-footer-paralalx-init'); $(window).load(function (){ gillion_footer_parallax(); gillion_footer_parallax_visible(); }); $(window).resize(function(){ clearTimeout(window.resizedFinishedFooter); window.resizedFinishedFooter=setTimeout(function(){ gillion_footer_parallax(); }, 500); }); $(window).scroll(gillion_footer_parallax_visible); } $('.post-title, .responsive-post-read-later, .desktop-post-read-later').on('click', function(e){ var title_class=$(e.target).attr('class'); if(title_class=='post-read-later'||title_class=='fa fa-bookmark-o'||title_class=='fa fa-bookmark'){ e.stopPropagation(); e.preventDefault(); if(gillion.loggedin==true){ if(title_class=='fa fa-bookmark-o'||title_class=='fa fa-bookmark'){ var self=$(e.target).parent(); }else{ var self=$(e.target); } $.ajax({ dataType: 'json', type: 'POST', url: gillion.siteurl+"wp-admin/admin-ajax.php", data:{ action:'read_later_trigger', type:self.attr('data-type'), post_id:self.attr('data-id'), }, success: function(response){ if(response['post_id'] > 0){ if(response['commit']=='remove'){ $('.post-read-later[data-id='+self.attr('data-id')+']').attr('data-type','add').html(''); $('.sh-read-later-item[data-id='+ response['post_id'] +']').remove(); $('.sh-read-later-total').html(parseInt($('.sh-read-later-total').html()) - 1); }else if(response['commit']=='add'){ $('.post-read-later[data-id='+self.attr('data-id')+']').attr('data-type','remove').html(''); $('.sh-read-later-list').prepend(response['body']); $('.sh-read-later-total').html(parseInt($('.sh-read-later-total').html()) + 1); }} }}); } return false; }}); $('.sh-read-later-list').on('click', '.sh-read-later-delete', function(e){ var self=$(this).parent().parent().parent(); $.ajax({ type: "POST", url: gillion.siteurl+"wp-admin/admin-ajax.php", data:{ action:'read_latter_delete', post_id:self.attr('data-id') }, success: function(response){ $('.sh-read-later-total').html(parseInt($('.sh-read-later-total').html()) - 1); $('.post-read-later[data-id='+ parseInt(self.attr('data-id')) +']').attr('data-type', 'add').html('') self.fadeOut(300, function(){ $(this).remove(); return false; }); }}); }); $('.sh-read-later-list').on('click', '.sh-read-later-item', function(e){ if($(e.target).attr('class')=='sh-read-later-link'&&$(e.target).attr('data-href')){ window.location.href=$(e.target).attr('data-href'); } return false; }); $(window).load(function(){ $('.sh-nav-menu').on('click', function(){ var slide_menu_icon=$(this).find('i'); if(!slide_menu_icon.hasClass('open')){ slide_menu_icon.attr('class', slide_menu_icon.attr('data-attr-opened')+' open'); }else{ slide_menu_icon.attr('class', slide_menu_icon.attr('data-attr-closed')); } $('.sh-header-side').show(0).css('transform','translateX(0px)'); $('.sh-header-side-overlay').show(0).css('opacity','1'); return false; }); $('.sh-header-side-overlay, .sh-header-side-close').on('click', function(){ $('.sh-header-side').css('transform','translateX(320px)').delay(350).hide(0); $('.sh-header-side-overlay').css('opacity','0').delay(350).hide(0); var slide_menu_icon=$('.sh-nav-menu i'); if(!slide_menu_icon.hasClass('open')){ slide_menu_icon.attr('class', slide_menu_icon.attr('data-attr-opened')+' open'); }else{ slide_menu_icon.attr('class', slide_menu_icon.attr('data-attr-closed')); }}); }); $(window).on('load resize', function(){ if($(document).width() > 768){ $('.blog-style-left .post-item, .blog-style-left-right .post-item').each(function(){ $(this).find('.post-container-right').css('height', $(this).find('.post-container').css('height')); }); }else{ $('.blog-style-left .post-item, .blog-style-left-right .post-item').each(function(){ $(this).find('.post-container-right').css('height', ''); }); } $('.sh-post-author-info').css('height', $('.sh-post-author').height()); $('.sh-404-page > .row > .col-md-6').each(function(){ $(this).css('height', ''); }); var page_404_height=$('.sh-404-page').height(); $('.sh-404-page > .row > .col-md-6').each(function(){ $(this).css('height', page_404_height); }); }); $('.post-media-play-overlay').on('click', function(ev){ var videoURL=$(this).parent().find('iframe').prop('src'); if(!videoURL.match(/vimeo.com/)){ $(this).parent().find('iframe').attr('src', $(this).parent().parent().find('iframe').attr('src') + "&wmode=transparent&autoplay=1&showinfo=0&controls=0&auto_play=true"); }else{ $(this).parent().find('iframe').attr('src', $(this).parent().parent().find('iframe').attr('src') + "?autoplay=1"); } $(this).remove(); ev.preventDefault(); }); if($('.post-gallery-list-background').length){ $('.post-gallery-list-background').slick({ fade: true, swipe: false, dots: false, arrows: false, cssEase: 'cubic-bezier(0.445, 0.05, 0.55, 0.95)', }); $('.post-gallery-list-background').on('init reInit afterChange', function (event, slick, currentSlide, nextSlide){ var i=(currentSlide ? currentSlide:0) + 1; $(this).parents('.sh-ratio-content').find('.post-gallery-pagination-inside-cover').text(i + '/' + slick.slideCount); }); $('.post-cover-gallery-prev').click(function(){ $(this).parents('.sh-ratio-content').find('.post-gallery-list-background').slick('slickPrev'); }) $('.post-cover-gallery-next').click(function(){ $(this).parents('.sh-ratio-content').find('.post-gallery-list-background').slick('slickNext'); }); $(window).resize(function(){ clearTimeout(window.resizedFinished3); window.resizedFinished3=setTimeout(function(){ $('.post-gallery-list-background').slick('refresh'); }, 500); }); } $('.post-gallery-list:not(.post-gallery-list-background)').slick({ fade: true, swipe: false, dots: false, arrows: true, cssEase: 'cubic-bezier(0.445, 0.05, 0.55, 0.95)', prevArrow: '', nextArrow: '' }); $('.post-gallery-list:not(.post-gallery-list-background)').on('init reInit afterChange', function (event, slick, currentSlide, nextSlide){ var i=(currentSlide ? currentSlide:0) + 1; $(this).parents('.post-gallery').find('.post-gallery-pagination').text(i + '/' + slick.slideCount); }); $('.post-gallery-list-row').each(function(){ var gallery_count=$(this).find('.post-gallery-list-col').length; if(gallery_count==1){ $(this).find('.post-gallery-list-col').addClass('post-gallery-list-col1'); }else if(gallery_count==2){ $(this).find('.post-gallery-list-col').addClass('post-gallery-list-col2'); }}); $('.sh-widget-facebook-overlay').on('click', function(ev){ $(this).fadeOut(300); setTimeout(function(){ $(this).remove(); }, 300); ev.preventDefault(); }); $('.sh-widget-twitter-list').each(function(){ var self_slider=$(this); $(self_slider).slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, infinite: false, speed: 900, cssEase: 'ease-in-out', autoplay: true, autoplaySpeed: 6000, dots: false, appendArrows: $(self_slider).parent().find('.widget-slide-arrows'), prevArrow: '', nextArrow: '' }); }); $('.sh-widget-posts-slider-init').each(function(){ var self_slider=$(this); $(self_slider).slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, infinite: false, speed: 900, cssEase: 'ease-in-out', autoplay: false, dots: false, appendArrows: $(self_slider).parent().find('.widget-slide-arrows'), prevArrow: '', nextArrow: '' }); }); $(".post-content-share-bar").jsSocials({ showLabel: false, showCount: false, shares: ["twitter", "facebook", "googleplus", "pinterest"] }); $(".vcg-image-container-social").each(function(){ $(this).jsSocials({ showLabel: false, showCount: false, shares: ["facebook", "twitter", "email","googleplus", "pinterest"], url: $(this).attr('data-url'), text: $(this).attr('data-title'), }); }); $(".post-content-share-side").each(function(){ $(this).jsSocials({ showLabel: false, showCount: false, shares: ["twitter", "facebook", "googleplus", "pinterest"], url: $(this).attr('data-url'), text: $(this).attr('data-title'), }); }); $(".post-content-share-bar").each(function(){ var self_share=$(this); $(self_share).stick_in_parent({ offset_top: $('.sh-header').height() + $('#wpadminbar').height() + 15 }); }); $('#sidebar').theiaStickySidebar({ additionalMarginTop: parseInt($('.sh-header').height() + $('#wpadminbar').height() + 15), minWidth: 1026 }); $('.post-related').slick({ slidesToShow: 3, slidesToScroll: 3, arrows: true, infinite: false, speed: 900, cssEase: 'ease-in-out', autoplay: false, dots: false, appendArrows: $('.post-slide-arrows'), prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 799, settings: { slidesToShow: 2, slidesToScroll: 2, }}, { breakpoint: 600, settings: { slidesToShow: 1, slidesToScroll: 1, }} ] }); $('.blog-slider-mini-list').perfectScrollbar(); $('.sh-categories-list').perfectScrollbar(); $('.sh-read-later-list').perfectScrollbar().removeClass('sh-read-later-list-init'); $('a[data-rel^=lightcase-post]').each(function(){ $(this).lightcase(); }); $('.sh-hamburger-menu').click(function(){ $(this).toggleClass('open'); }); $('.widget-item.widget_tag_cloud').each(function(){ $(this).find('a').each(function(){ $(this).html('#' + $(this).html()); }); }); if(gillion.loggedin==false){ $('.post-read-later').tooltipster({ theme: 'tooltipster-borderless' }); } if($('.sh-widget-facebook-item').length){ $('.sh-widget-facebook-item').on("mouseover", function (){ $(this).append('
'); $(this).append(''); }); } $('#sidebar .mc4wp-form-name').remove(); }); (function (){ var defaultOptions={ frameRate:150, animationTime:400, stepSize:65, pulseAlgorithm:true, pulseScale:4, pulseNormalize:1, accelerationDelta:50, accelerationMax:3, keyboardSupport:true, arrowScroll:50, fixedBackground:true, excluded:'' }; var options=defaultOptions; var isExcluded=false; var isFrame=false; var direction={ x: 0, y: 0 }; var initDone=false; var root=document.documentElement; var activeElement; var observer; var refreshSize; var deltaBuffer=[]; var isMac=/^Mac/.test(navigator.platform); var key={ left: 37, up: 38, right: 39, down: 40, spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 }; var arrowKeys={ 37: 1, 38: 1, 39: 1, 40: 1 }; function initTest(){ if(options.keyboardSupport){ addEvent('keydown', keydown); }} function init(){ if(initDone||!document.body) return; initDone=true; var body=document.body; var html=document.documentElement; var windowHeight=window.innerHeight; var scrollHeight=body.scrollHeight; root=(document.compatMode.indexOf('CSS') >=0) ? html:body; activeElement=body; initTest(); if(top!=self){ isFrame=true; } else if(isOldSafari && scrollHeight > windowHeight && (body.offsetHeight <=windowHeight || html.offsetHeight <=windowHeight)){ var fullPageElem=document.createElement('div'); fullPageElem.style.cssText='position:absolute; z-index:-10000; ' + 'top:0; left:0; right:0; height:' + root.scrollHeight + 'px'; document.body.appendChild(fullPageElem); var pendingRefresh; refreshSize=function (){ if(pendingRefresh) return; pendingRefresh=setTimeout(function (){ if(isExcluded) return; fullPageElem.style.height='0'; fullPageElem.style.height=root.scrollHeight + 'px'; pendingRefresh=null; }, 500); }; setTimeout(refreshSize, 10); addEvent('resize', refreshSize); var config={ attributes: true, childList: true, characterData: false }; observer=new MutationObserver(refreshSize); observer.observe(body, config); if(root.offsetHeight <=windowHeight){ var clearfix=document.createElement('div'); clearfix.style.clear='both'; body.appendChild(clearfix); }} if(!options.fixedBackground&&!isExcluded){ body.style.backgroundAttachment='scroll'; html.style.backgroundAttachment='scroll'; }} function cleanup(){ observer&&observer.disconnect(); removeEvent(wheelEvent, wheel); removeEvent('mousedown', mousedown); removeEvent('keydown', keydown); removeEvent('resize', refreshSize); removeEvent('load', init); } var que=[]; var pending=false; var lastScroll=Date.now(); function scrollArray(elem, left, top){ directionCheck(left, top); if(options.accelerationMax!=1){ var now=Date.now(); var elapsed=now - lastScroll; if(elapsed < options.accelerationDelta){ var factor=(1 + (50 / elapsed)) / 2; if(factor > 1){ factor=Math.min(factor, options.accelerationMax); left *=factor; top *=factor; }} lastScroll=Date.now(); } que.push({ x: left, y: top, lastX: (left < 0) ? 0.99:-0.99, lastY: (top < 0) ? 0.99:-0.99, start: Date.now() }); if(pending){ return; } var scrollWindow=(elem===document.body); var step=function (time){ var now=Date.now(); var scrollX=0; var scrollY=0; for (var i=0; i < que.length; i++){ var item=que[i]; var elapsed=now - item.start; var finished=(elapsed >=options.animationTime); var position=(finished) ? 1:elapsed / options.animationTime; if(options.pulseAlgorithm){ position=pulse(position); } var x=(item.x * position - item.lastX) >> 0; var y=(item.y * position - item.lastY) >> 0; scrollX +=x; scrollY +=y; item.lastX +=x; item.lastY +=y; if(finished){ que.splice(i, 1); i--; }} if(scrollWindow){ window.scrollBy(scrollX, scrollY); }else{ if(scrollX) elem.scrollLeft +=scrollX; if(scrollY) elem.scrollTop +=scrollY; } if(!left&&!top){ que=[]; } if(que.length){ requestFrame(step, elem, (1000 / options.frameRate + 1)); }else{ pending=false; }}; requestFrame(step, elem, 0); pending=true; } function wheel(event){ if(!initDone){ init(); } var target=event.target; if(event.defaultPrevented||event.ctrlKey){ return true; } if(isNodeName(activeElement, 'embed') || (isNodeName(target, 'embed')&&/\.pdf/i.test(target.src)) || isNodeName(activeElement, 'object') || target.shadowRoot){ return true; } var deltaX=-event.wheelDeltaX||event.deltaX||0; var deltaY=-event.wheelDeltaY||event.deltaY||0; if(isMac){ if(event.wheelDeltaX&&isDivisible(event.wheelDeltaX, 120)){ deltaX=-120 * (event.wheelDeltaX / Math.abs(event.wheelDeltaX)); } if(event.wheelDeltaY&&isDivisible(event.wheelDeltaY, 120)){ deltaY=-120 * (event.wheelDeltaY / Math.abs(event.wheelDeltaY)); }} if(!deltaX&&!deltaY){ deltaY=-event.wheelDelta||0; } if(event.deltaMode===1){ deltaX *=40; deltaY *=40; } var overflowing=overflowingAncestor(target); if(!overflowing){ if(isFrame&&isChrome){ Object.defineProperty(event, "target", {value: window.frameElement}); return parent.wheel(event); } return true; } if(isTouchpad(deltaY)){ return true; } if(Math.abs(deltaX) > 1.2){ deltaX *=options.stepSize / 120; } if(Math.abs(deltaY) > 1.2){ deltaY *=options.stepSize / 120; } scrollArray(overflowing, deltaX, deltaY); event.preventDefault(); scheduleClearCache(); } function keydown(event){ var target=event.target; var modifier=event.ctrlKey||event.altKey||event.metaKey || (event.shiftKey&&event.keyCode!==key.spacebar); if(!document.body.contains(activeElement)){ activeElement=document.activeElement; } var inputNodeNames=/^(textarea|select|embed|object)$/i; var buttonTypes=/^(button|submit|radio|checkbox|file|color|image)$/i; if(event.defaultPrevented || inputNodeNames.test(target.nodeName) || isNodeName(target, 'input')&&!buttonTypes.test(target.type) || isNodeName(activeElement, 'video') || isInsideYoutubeVideo(event) || target.isContentEditable || modifier){ return true; } if((isNodeName(target, 'button') || isNodeName(target, 'input')&&buttonTypes.test(target.type)) && event.keyCode===key.spacebar){ return true; } if(isNodeName(target, 'input')&&target.type=='radio' && arrowKeys[event.keyCode]){ return true; } var shift, x=0, y=0; var overflowing=overflowingAncestor(activeElement); if(!overflowing){ return (isFrame&&isChrome) ? parent.keydown(event):true; } var clientHeight=overflowing.clientHeight; if(overflowing==document.body){ clientHeight=window.innerHeight; } switch (event.keyCode){ case key.up: y=-options.arrowScroll; break; case key.down: y=options.arrowScroll; break; case key.spacebar: shift=event.shiftKey ? 1:-1; y=-shift * clientHeight * 0.9; break; case key.pageup: y=-clientHeight * 0.9; break; case key.pagedown: y=clientHeight * 0.9; break; case key.home: y=-overflowing.scrollTop; break; case key.end: var scroll=overflowing.scrollHeight - overflowing.scrollTop; var scrollRemaining=scroll - clientHeight; y=(scrollRemaining > 0) ? scrollRemaining + 10:0; break; case key.left: x=-options.arrowScroll; break; case key.right: x=options.arrowScroll; break; default: return true; } scrollArray(overflowing, x, y); event.preventDefault(); scheduleClearCache(); } function mousedown(event){ activeElement=event.target; } var uniqueID=(function (){ var i=0; return function (el){ return el.uniqueID||(el.uniqueID=i++); };})(); var cache={}; var clearCacheTimer; function scheduleClearCache(){ clearTimeout(clearCacheTimer); clearCacheTimer=setInterval(function (){ cache={};}, 1*1000); } function setCache(elems, overflowing){ for (var i=elems.length; i--;) cache[uniqueID(elems[i])]=overflowing; return overflowing; } function overflowingAncestor(el){ var elems=[]; var body=document.body; var rootScrollHeight=root.scrollHeight; do { var cached=cache[uniqueID(el)]; if(cached){ return setCache(elems, cached); } elems.push(el); if(rootScrollHeight===el.scrollHeight){ var topOverflowsNotHidden=overflowNotHidden(root)&&overflowNotHidden(body); var isOverflowCSS=topOverflowsNotHidden||overflowAutoOrScroll(root); if(isFrame&&isContentOverflowing(root) || !isFrame&&isOverflowCSS){ return setCache(elems, getScrollRoot()); }}else if(isContentOverflowing(el)&&overflowAutoOrScroll(el)){ return setCache(elems, el); }} while (el=el.parentElement); } function isContentOverflowing(el){ return (el.clientHeight + 10 < el.scrollHeight); } function overflowNotHidden(el){ var overflow=getComputedStyle(el, '').getPropertyValue('overflow-y'); return (overflow!=='hidden'); } function overflowAutoOrScroll(el){ var overflow=getComputedStyle(el, '').getPropertyValue('overflow-y'); return (overflow==='scroll'||overflow==='auto'); } function addEvent(type, fn){ window.addEventListener(type, fn, false); } function removeEvent(type, fn){ window.removeEventListener(type, fn, false); } function isNodeName(el, tag){ return (el.nodeName||'').toLowerCase()===tag.toLowerCase(); } function directionCheck(x, y){ x=(x > 0) ? 1:-1; y=(y > 0) ? 1:-1; if(direction.x!==x||direction.y!==y){ direction.x=x; direction.y=y; que=[]; lastScroll=0; }} var deltaBufferTimer; if(window.localStorage&&localStorage.SS_deltaBuffer){ try { deltaBuffer=localStorage.SS_deltaBuffer.split(','); } catch (e){ }} function isTouchpad(deltaY){ if(!deltaY) return; if(!deltaBuffer.length){ deltaBuffer=[deltaY, deltaY, deltaY]; } deltaY=Math.abs(deltaY); deltaBuffer.push(deltaY); deltaBuffer.shift(); clearTimeout(deltaBufferTimer); deltaBufferTimer=setTimeout(function (){ try { localStorage.SS_deltaBuffer=deltaBuffer.join(','); } catch (e){ }}, 1000); return !allDeltasDivisableBy(120)&&!allDeltasDivisableBy(100); } function isDivisible(n, divisor){ return (Math.floor(n / divisor)==n / divisor); } function allDeltasDivisableBy(divisor){ return (isDivisible(deltaBuffer[0], divisor) && isDivisible(deltaBuffer[1], divisor) && isDivisible(deltaBuffer[2], divisor)); } function isInsideYoutubeVideo(event){ var elem=event.target; var isControl=false; if(document.URL.indexOf ('www.youtube.com/watch')!=-1){ do { isControl=(elem.classList && elem.classList.contains('html5-video-controls')); if(isControl) break; } while (elem=elem.parentNode); } return isControl; } var requestFrame=(function (){ return (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback, element, delay){ window.setTimeout(callback, delay||(1000/60)); }); })(); var MutationObserver=(window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver); var getScrollRoot=(function(){ var SCROLL_ROOT; return function(){ if(!SCROLL_ROOT){ var dummy=document.createElement('div'); dummy.style.cssText='height:10000px;width:1px;'; document.body.appendChild(dummy); var bodyScrollTop=document.body.scrollTop; var docElScrollTop=document.documentElement.scrollTop; window.scrollBy(0, 3); if(document.body.scrollTop!=bodyScrollTop) (SCROLL_ROOT=document.body); else (SCROLL_ROOT=document.documentElement); window.scrollBy(0, -3); document.body.removeChild(dummy); } return SCROLL_ROOT; };})(); function pulse_(x){ var val, start, expx; x=x * options.pulseScale; if(x < 1){ val=x - (1 - Math.exp(-x)); }else{ start=Math.exp(-1); x -=1; expx=1 - Math.exp(-x); val=start + (expx * (1 - start)); } return val * options.pulseNormalize; } function pulse(x){ if(x >=1) return 1; if(x <=0) return 0; if(options.pulseNormalize==1){ options.pulseNormalize /=pulse_(1); } return pulse_(x); } var userAgent=window.navigator.userAgent; var isEdge=/Edge/.test(userAgent); var isChrome=/chrome/i.test(userAgent)&&!isEdge; var isSafari=/safari/i.test(userAgent)&&!isEdge; var isMobile=/mobile/i.test(userAgent); var isIEWin7=/Windows NT 6.1/i.test(userAgent)&&/rv:11/i.test(userAgent); var isOldSafari=isSafari&&(/Version\/8/i.test(userAgent)||/Version\/9/i.test(userAgent)); var isEnabledForBrowser=(isChrome||isSafari||isIEWin7)&&!isMobile; var wheelEvent; if('onwheel' in document.createElement('div')) wheelEvent='wheel'; else if('onmousewheel' in document.createElement('div')) wheelEvent='mousewheel'; if(wheelEvent&&isEnabledForBrowser){ addEvent(wheelEvent, wheel); addEvent('mousedown', mousedown); addEvent('load', init); } function SmoothScroll(optionsToSet){ for (var key in optionsToSet) if(defaultOptions.hasOwnProperty(key)) options[key]=optionsToSet[key]; } SmoothScroll.destroy=cleanup; if(window.SmoothScrollOptions) SmoothScroll(window.SmoothScrollOptions); if(typeof define==='function'&&define.amd) define(function(){ return SmoothScroll; }); else if('object'==typeof exports) module.exports=SmoothScroll; else window.SmoothScroll=SmoothScroll; })(); !function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);